[NTLUG:Discuss] Shell script help 2
. Daniel
xdesign at hotmail.com
Fri May 12 10:58:36 CDT 2006
Also on my list of "seems simple enough" things to script:
A simple backup script. Basically, what I want is this:
backup.sh source_dir backup_dir
where the copy operation is controlled like this:
Recursively copy all files from the source_dir to the backup_dir.
If the file from the source exists in the destination, compare dates.
If the source is newer, replace the destination file, if not, move on.
* I do want to keep files that have been deleted from the source... people
often delete things they wish they hadn't...
In my searches, I have found where comparing file dates would be trivial.
(see http://www.tldp.org/LDP/abs/html/fto.html) So now I just need to
figure out how to make a script read filenames in and process them as
indicated above.
Now I know there are likely to be other methods, but I want to do this as a
script for educational purposes as well as for reasons having to do with
portability. (I hope to bring that script over to MacOSX as part of my
backup activity replacing 'retrospect' which I find to be clumbsy and
difficult when scripting such a task.)
More information about the Discuss
mailing list