[SOLVED] Rsync refuses to create folder.
I'm using Ubuntu 10.04 32 bit but this should apply to linux, in general.
I am having a curious problem with an rsync script. Although I could opt to just back up my complete home folder, I choose to be selective and only backup what I would actually need if a hard drive disaster occurred. I am having difficulty backing up properly when I back up files in a subfolder but no files from the base folder the subfolder is under. Rsync refuses to create the base folder in the backup target partition and therefore will not create the subfolder and files either.
Here's an example. It's my ".config" folder. There are a number of subfolders but I am only interested in backing up the "transmission" subfolder. My line for that in my script is this:
When I run it I get this error message:
rsync -arv /home/trapper/.config/transmission/ /media/RSYNC-Backup/trapper/.config/transmission/
However, this works and creates the .mozilla folder and it's entire contents, including subfolders & all subfolder files, at the backup target.
rsync: mkdir "/media/RSYNC-Backup/trapper/.config/transmission" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(595) [Receiver=3.0.7]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(601) [sender=3.0.7]
Just to test, I added this to my script just prior to the transmission backup line:
rsync -arv /home/trapper/.mozilla/ /media/RSYNC-Backup/trapper/.mozilla/
The function above created the .config folder at the target and then the transmission folder backed up properly.
if [ ! -d /media/RSYNC-Backup/trapper/.config ]
I obviously have something wrong and am confused over the fact that rsync refuses to automagically create a ,config base folder for me. What do I not know that I should know?