I am trying to use RSYNC to copy files from one hard drive to another (as a sort of accessable backup). I have written the BASH "SH" script and also configured CRONTAB. The files get copied accross just fine, however the folder name on the receiving side has a blank string suffix after it. Because of this suffix, i can not share the folder.
my Bash script is:
rsync -av /mnt/sda1/Folder/ /mnt/sdb1/Folder
Please help - Thank you
There doesnt look anything wrong with that
Can you clarify what you mean by a "blank string suffix"? Do you mean the target directory, instead of being called "Folder", is called "Folder "? I agree with kern, there appears to be nothing wrong with your script, and I've never come across the problem you're describing.
Anything unusual about your setup? Which distro/release you using? What happens when you manually do the rsync command - does it work?
One last thing, check your script very carefully. It's within the realm of possibility you've got an embedded space in the command that isn't being parsed properly by cron and it's adding it to the name. Try manually(and carefully) retyping the rsync line after being sure to completely delete the original line. Also, just for laughs, be sure you have a blank line with a carriage return at the end of the script. None of this will necessarily help, it's all just little things that might effect it depending on version of cron, rsync, etc.
Thanks for the help. it works beautifully now. there was an extra line in the script which i just failed to see. Take it out and the thing works like a charm. thanks for the advise.