September 28Sep 28 Hi folks can anyone point me in the right direction PLEASEAfter op error i managed to delete my whole Tv shows directory (don't ask) so over the weekend i backed up from my other unraid server using Krusader. Now the problem, i had a script that ran every night backing up any new shows but now if i try to run the script again it want to copy over everything again. After some research (AI) its ask me to try these commands but it still want to copy everything again.rsync -avzP --ignore-existing --dry-run /path/to/source/ user@remote-server:/path/to/destination/rsync -avzP --size-only --ignore-times --dry-run /path/to/source/ user@remote-server:/path/to/destination/Be gently please but can anyone point me in the right direction
September 28Sep 28 The Krusader restore may have changed the modification times. Rsync normally compares file sizes and modification times to decide what needs copying.However, --ignore-existing should skip files already at the destination. We need to see the actual paths and output to understand why that attempt still appears to copy everything.Could you post:- The original nightly rsync command.- Which server runs it and which server should receive the backup.- About 10–20 lines of output, including any errors, after adding --dry-run --itemize-changes to that rsync command.Keep --dry-run enabled so rsync makes no changes. If the script contains other commands, run only the rsync command for this test.You can redact server names and personal folder names, but preserve the directory structure and trailing slashes. Those affect where rsync looks for existing files.The itemized output will help distinguish file transfers from timestamp or permission updates. Then we can suggest the right correction.
September 28Sep 28 Author Hi thanks for replying see below sent 104,055 bytes received 5,248 bytes 218,606.00 bytes/sectotal size is 1,799,293,836,489 speedup is 16,461,522.89 (DRY RUN)rsync -avzP --ignore-times --dry-run /mnt/user/Tv-Shows /mnt/remotes/UNRAID2_TvshowsHope this helps
September 28Sep 28 Solution 38 minutes ago, coblck said:rsync -avzP --ignore-times --dry-run /mnt/user/Tv-Shows /mnt/remotes/UNRAID2_TvshowsIs this the problem?AI output from Google, If the trailing slash is not present in the source path and the destination path is directory where you want the files, rsync creates the source directory in the destination directory and then fills that directory with the contents of the source. The BOLD text in the quote is showing no trailing slash so a directory named 'Tv-Shows' will being created in 'UNRAID2_Tvshows' and the contents of 'Tv_Shows' copied into it.
September 28Sep 28 Author Changed to this as suggested "sync -avP /mnt/user/Tvshows/ /mnt/remotes/UNRAID1_Tv-Shows" and now works thanks so much for your help just when you think your getting to grips with something this happens once again thanks
September 28Sep 28 Don't feel bad! You are not the first one to be bit by this!!!! The trailing slash in Linux/UNIX is a non-issue 95% of the time. There are just a few commands where it comes into play and rsync is one of them.
September 28Sep 28 Author Would you recommend adding --delete so "rync -avP --delete /mnt/user/Tvshows/ /mnt/remotes/UNRAID1_Tv-Shows" so it will delete any files that i remove ???? Edited September 28Sep 28 by coblck
September 28Sep 28 19 minutes ago, coblck said:Would you recommend adding --delete so "rync -avP --delete /mnt/user/Tvshows/ /mnt/remotes/UNRAID1_Tv-Shows" so it will delete any files that i remove ????I have used that switch to remove files from my backup that I deleted from the source. However, I only use it periodically when I know that there are files in the backup that I can safely remove. (As I recall, you could use this command-- with the --delete switch --to both copy new material to the backup while deleting files from the backup that are no longer in the source.) But I am always paranoid about a command that automatically deletes things when I am actually doing a normal backup. I want any 'delete' operation to a conscience action on my part if you know what I mean. That prevents the cockpit error of deleting a file from the source (that I really want to have) from being deleted from the backup achieve before I realize the first error (hopefully). Edited September 28Sep 28 by Frank1940
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.