> On UNIX, I am  executing an rsync command, from within a script. The command 
> goes something like this:
> 
> /usr/bin/rsync --verbose  --progress --stats --compress --recursive --times 
> --perms --links  --safe-links source_dir/ 
> user@target_machine:/parent_path/source_dir  
> 
> In other words, I am replicating source_dir on a remote machine. It ends up 
> next to a lot of sibling, directories, like this:
> 
> On target_machine
> 
> /parent_path/source_dir
> /parent_path/source_dir2
> ....
> /parrent_path/source_dirn
> 
> Here's my issue. I'd like to use the --delete option in the command above. 
> However, I wake up in a cold sweat worrying about supplying the empty 
> string for source_dir, and thus removing souce_dir, and all it's siblings on 
> target_machine.
> 
> Now I realize, I can just be extra careful that the variable pointing to 
> source_string is never empty, but I would like to have other fail safe 
> mechanisms in place.
> 
> I hope I have been sufficiently specific to elicit some suggestions. I guess 
> I am looking for the software equivalent of lots of padlocks on the apartment 
> door.

You may wish to consider the use of the -n option. The --dry-run option 
performs a trial run with no changes made. Using this option will allow you to 
check what will happen prior to actually moving ahead.

Just a possibility?


---------------------------------------------------------------------
This email is protected by LBackup, an open source backup solution.
http://www.lbackup.org





-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to