[plug] Ambiguous redirection error

Jason Nicholls jason at mindsocket.com.au
Sun May 12 08:28:13 WST 2002


On Sat, May 11, 2002 at 01:45:07AM +0800, Richard wrote:
> I am currently trying to write a script(s) that will backup certain personal 
> files on a regular basis. My email is one of the things I would like to 
> backup and, using kmail, it resides in a single dir, Mail, in mbox format. I 
> have been trying to work out a command to append all files in the Mail dir to 
> their name sake in a separate backup dir, which would then be re-archived. I 
> have been trying to redirect the output of the cat command to the backup 
> files and using the * to perform the action on all files in the dir, but I 
> keep getting the error message 'ambiguous redirection'. I could explicitly 
> name all of my mail files/folders in the script but would like to avoid 
> having to update the script every time a new folder is added in kmail. Could 
> anyone suggest a command-line string that would have the desired effect? Or a 
> better way of regularly archiving my mail (if I'm in danger of re-inventing 
> the wheel :) Thanks.

Try rsync, whether it's across systems (backup on a different machine) or to
the same machine it'll probably be faster than your method or tar. 

example:

    /usr/bin/rsync -vaurR --delete /dir1 /dir2

# -u = update only (don't overwrite newer files)
# -r = recursive
# -R = relative (relative to the remDir in our case)
# --delete = delete files that don't exist (good here because we're making
#            backups that won't be touched).

This will copy dir1 to dir2 recursively, ie: all files, all subdirectories.


Later,

Jason Nicholls
--------------------------------------------------------------------
Jason Nicholls    icq: 11745841    email: <jason at mindsocket.com.au>
http://jason.mindsocket.com.au/    mobile: 0417 410 811
--------------------------------------------------------------------
   pgp/gpg id: 0xC3844959  
  fingerprint: 7F7A 5846 4E94 459C 104D  A979 7079 24CF C384 4959



More information about the plug mailing list