![]() Sent 38.33M bytes received 1.02M bytes 7.15M bytes/sec Total transferred file size: 35.30M bytes Just keep in mind it is permanently deleting them, NOT sending them to some sort of recycle bin or something, so watch out! Pay careful attention to that, as deleting files can't be undone (at least not without special software recovery tools). ![]() Here's an example of a -stats output obtained from doing the MIRROR option below. Be sure to review the stats paragraph printout (which printed because you had -stats) at the end of the stdout.log file before running the script for real, to make sure it all looks good. Remove -dry-run from the above when ready to actually make the copy. Here I remove the progress indicator by removing -info=progress2, just so the log files don't get polluted with progress info everywhere: (sudo rsync -rah -verbose -dry-run -stats '/path/to/source' '/path/to/destination' | tee -a '/path/to/stdout.log') 3>&1 1>&2 2>&3 | tee -a '/path/to/stderr.log' Optionally, you may also log the entire list of files to be copied to a stdout.log file like this, and any errors to a stderr.log file like this. Optionally, add -dry-run to show what would happen but NOT ACTUALLY DO IT YET. Optionally, add -verbose, or just -v (or -rahv in my case) to also get a full list of exactly what will be copied. Here's a few of my favorite rsync commands:ĬOPY from source to destination, leaving anything in the destination that isn't conflicting still intact: sudo rsync -rah -stats -info=progress2 '/path/to/source' '/path/to/destination' It's a command-line-only tool, and harder to use, but still very powerful, albeit not quite as powerful as FreeFileSync since it doesn't handle two-way syncing very well. If you are doing the copy from Linux, you may also use FreeFileSync of course, but if your'e a command-line guru you might like rsync better. rsync Command-line tool (Linux, Windows with Cygwin) (AKA: "How to use rsync"): Ensure you see nothing next to the trash can (indicating what is to be deleted), or that you see expected files to be deleted, as marked with the trash can and a minus sign, and then press the "Synchronize" button to begin. Once it determines what it needs to copy, it will pop up an info screen showing what it's going to do (how many files it will create, overwrite, or delete, etc.). Just set up your folders with source on the left and destination on the right, then click the gear at the top right and choose the "Mirror" option to mirror from left to right, then press the "Compare" button at the top left. Just be sure not to screw it up and copy backwards, deleting everything! That's not hard to get right, however, since it's graphical and very user-friendly. It is graphical, no cost, free and open source, and cross-platform (Windows, Mac, Linux). To ensure you don't miss any data, I highly highly recommend using a good file-copy tool like FreeFileSync. FreeFileSync GUI tool (Windows, Mac, Linux)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |