Copy files using GUI, chown as different user?

Associate
Joined
19 Jun 2003
Posts
1,680
Location
West Yorks, UK
Hi all
I'm trying to set something up for a colleague who doesn't know their way around the terminal (and doesn't want/need to learn). I need them to be able to plug a USB drive into the machine, running Ubuntu 6.10, and copy files into a directory using a GUI. Nothing difficult here, except that the files need to be chown'ed by a user that isn't the one they logged in as, and isn't root.

I was hoping i could do
Code:
gksudo -u otheruser nautilus /storage/
to open a Nautilus window as that user. It doesn't seem to work however.

Are there any other options? Could I mount the folder somewhere and force it to chown all files/folders as otheruser?

Cheers,
Matt
 
GKsudo isn't going to chown the files, it's just going to run nautilus under the assumed users permissions...

And what is the fileformat of the USB stick? if it's FAT or NTFS they aren't going to have Unix style permissions attached to the files until you copy them to your local filesystem, at which point they should belong to that user?

You could write a script that chowns the files and have user run it from desktop, or have the users in the same group and use group permissions?
 
Ah, guess i've misunderstood gksu. Thought it would auto-chown the files as that user.

I have tried to make a script, but it seems like a long winded way to do something that should be quite easy.

Would mounting the folder with right options have any effect on the files copied into it?

Matt

PS., the data is from an NTFS partition on a USB hard drive. The actual permissions don't matter a jot, as long as the files are owned and grouped by a certain user. This is required so a piece of software can locate relevant files - I have no control over this process
 
Unless I've missed something obvious It is quite simple:

chown -R <newuser> /your/path

The -R part will recursively change the permissions of all the files within the folder. I know you said it needs to be a GUI but surely that's not too hard to do?
 
Last edited:
Unless I've missed something obvious It is quite simple:

chown -R <newuser> /your/path

The -R part will recursively change the permissions of all the files within the folder. I know you said it needs to be a GUI but surely that's not too hard to do?

In a script run from desktop, or shortcut or something equally as unnessecary for someone not willing to learn :)

But you will have to run the command as root (sudo in ubuntus case) or the desired user because you can't just go chowning any file you want.

What exactly is the purpose of this, maybe can suggest a better alternative with more info
 
One way around this would be to set up a cron job that chown's/chmod'ss the contents of the directory. It won't happen instantly but it should be good enough for most purposes.
 
Well, the process is this:

1) Data is brought in on a USB HDD

2) It is loaded onto our Server, by copying it into a folder relevant to it's source (e.g., Accounts dept.)

3) It has to be chown'ed/chgrp'ed by one particular user for a piece of data management software to work

4) Once the ownership is set properly, the software can run away quite happily


The above has to take place within about 2 hours max for the software to function correctly. There is currently around 750GB of data on the Server (mainly in sub 512K files), so chown'ing the files on schedule may take too long. I suppose i could run a script that looked for files that didn't have the right permission, and only chown them - would that be any quicker i wonder?

Matt
 
Back
Top Bottom