Rsync failure? Strange deletion happened today.
I have a code project I was working on all day, and wanted to back up the project directory to an external hard drive. I reviewed the rsync manual page to make sure I had the options and source/destination correct. After executing rsync, my project directory was empty, and so was the intended destination. The command history below tells the full story, (ALMOST exactly as shown but I have only modified local username for privacy):
Details: OS: Ubuntu 18.04.2 LTS External HDD: WD Elements WDBPCK0010BBK 1TB usb 3.0 Starting directory: /home/bob/code/pgf Code:
> ls -l /media/bob/Elements/code/Cpp/ Does anyone know what went wrong? My project is gone it seems and I have no idea how. |
1. I note you did not run any command to show us your current directory during the command run.
2. Runnig an rsyn from a folder onto itself is not recommended, and I cannot confirm from the information provided that this did not occur. 3. The options Quote:
4. I note you did not include anything like to -del option or from that family of options, so nothing SHOULD have been deleted. 5. Copying to a new directory, why were you using rsync? IT is a wonderful tool for syncing, but there are faster ways to get that initial copy. 6. I would almost ALWAYS (a) include the -v option for verbose output, and (b) use full path names for safety and clarity when running rsync. |
Quote:
2: Not sure what you mean? I ran rsync outside the source folder (see command #5, "cd .."), and to an external HDD directory. 3: ? 4: Right, which is why I'm confused. 5: Would cp have been a better command? 6: I will be sure to do this from now on (IF I ever use rsync again). Thanks. |
Quote:
try Code:
Code:
rsync -rvlptg --update /home/bob/code/pgf/ /media/bob/Elements/code/Cpp/pgf The --update "switch" tells the computer to only deal with files that have appeared/ changed since last update, so will save heaps of time when next you do an upate of your back up. |
All times are GMT -5. The time now is 06:49 PM. |