D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] copying files from a camera. using a shell script



On Sat, 7 Aug 2004 17:24:41 +0100
paul sutton <zen14920@xxxxxxxxx> wrote:

Thanks for that,  I have managed to fix it, for now anyway, but your script is 
a lot better than mine so i think it's a case of doing a rewrite,  and 
incorporating them together.  as you said the script can be expanded, so I 
want to do that, perhaps incorporate my lower case routine so all the 
characters are lower case.

a few questions

1. with the supermount -i disable,  is this session only or permanant?
2. WIth my script I had to change the ownership permissions, should i also 
need to change the group permissions from root to users?

Thanks again

Paul


Using the "-i" switch for supermount will make the changes directly to the file 
supplied by the "-f" switch (or directly to /etc/fstab if no filename is given with 
-f).  So, it's a permanent... until you re-enable it :D

If you wanted more control, you could try:
       supermount -i -m /media/camera disable
(the -m may need an = sign, as in -m=/media/camera).

With my version of the script, because it's copying with the "-a" switch, all 
permissions are retained.  So, since root mounted the device, all the files will be 
owned by root, and the directory, so bulk permission changes would be in order!  
Easily done, though, with:

--snip--
       echo "Making destination directory."
       mkdir /home/pausut/camera/$varDESTDIR
       echo "Copying files over..."
       cp /media/camera/* /home/pausut/camera/$varDESTDIR/ -va
       chown pausut:pausut /home/pausut/camera/$varDESTDIR -R  #recursively change 
owner to pausut on all files, including dirs.
       chmod -R 755 /home/pausut/camera/$varDESTDIR/*  #recursively change perms to 
Owner(RWX), Group(RX), Other(RX).
       case $? in
         0)
               echo "Completed copying files.";;
         1)
               echo "Error copying files!";;
       esac
       umount /media/camera
--snip--

HTH.

Grant.

-- 
Artificial intelligence is no match for nuratal stidutipy.

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.



Lynx friendly