Comment on When using rsync to backup my /home folder to an external 1TB SSD, I run out of space, how??
confusedpuppy@lemmy.dbzer0.com 14 hours ago
There might be a possibility that recursion is happening and a directory is looping into itself and filling up your storage.
I have some suggestions for your command to help make a more consistent experience with rsync.
1: –dry-run (-n) is great for troubleshooting issues. It performs a fake transfer so you can sort issues before moving any data. Remove this option when you are confident about making changes.
2: –verbose --human-readable (-vh) will give you visual feedback so you can see what is happening. Combine this with --dry-run so you get a full picture of what rsync will attempt to do before any changes are made.
3: –compress (-z) might not be suitable for this specific job, as I understand, it’s meant to compress data during a file transfer intended over a network. In your commands current state, it’s just adding extra processing power which might not be useful for a connected device.
4: If you are transferring directories/folders, I found more consistent behaviour from rsync by adding a trailing slash at the end of a path. For example use “/home/username/folder_name/” and not “/home/username/folder_name”. I’ve run into recursion issues by not using a trailing slash.
Don’t use a trailing slash if you are transferring a single file. That distinction helps me to understand what I’m transferring too.
5: –delete will make sure your source folder and destination folder are a 1:1 match. Any files deleted in the source folder will be deleted in the destination folder. If you want to keep any and all added files in your destination folder, this option can be ignored.
–archive (-a) and –partial --progress (-P) are both good and don’t need to be changed or removed.
If you do happen to be running into a recursion issue that’s filling up your storage, you may need to look into using the –exclude option to exclude the problem folder.
sbeak@sopuli.xyz 13 hours ago
How do I find which folder is causing problems? When using --verbose and --dry-run, it goes way too fast and the terminal can’t see all of the history
bleistift2@sopuli.xyz 13 hours ago
You can store the output of
rsyncin a file by usingrsync ALL_THE_OPTIONS_YOU_USED > rsync-output.txt. This creates a file called rsync-output.txt in your current directory which you can inspect later.This, however means that you won’t see the output right away. You can also use
rsync ALL_THE_OPTIONS_YOU_USED | tee rsync-output.txt, which will both create the file and display the output on your terminal while it is being produced.sbeak@sopuli.xyz 13 hours ago
Having a quick scroll of the output file (neat tip with the > to get a text file, thanks!) nothing immediately jumps out to me. There isn’t any repeated folders or anything like that from a glance. Anything I should look out for?
bleistift2@sopuli.xyz 13 hours ago
You checked 385GiB of files by hand? Is that size made up by a few humongously large files?
I suggest using
uniqto check if you have duplicate files in there. (uniq’s input must be sorted first). If you still have the output file from the previous step, and it’s calledrsync-output.txt, dosort rsync-output.txt | uniq -dc. This will print the duplicates and the number of their occurrences.confusedpuppy@lemmy.dbzer0.com 13 hours ago
If you don’t spot any recusion issues, I’d suggest looking for other issues and not spend too much time here. At least now you have some troubleshooting knowledge going forward. Best of luck figuring out the issue.
confusedpuppy@lemmy.dbzer0.com 13 hours ago
Does your terminal have a scroll back limit? You may need to change that setting if there is a limit.
That will depend on which terminal you are using and it may have a different name so I can’t really help more with this specific issue. You’ll have to search that up based on the terminal you are using.