backups - ovigia/distrosnetinstall GitHub Wiki
backups
página dedicada a tools de backup, como o rsync
índice
links
tools
dicas
You should never run rsync without using the
--dry-run
option first. This will give a detailed list of what would have happened had you run for real. You can combine the output with the--incremental
option to get the list of all changes. Finally, use the--log-file=FILE
option to write all changes to a report.
You should start testing with a dummy source and destination directory. You should make sure that you do not overwrite existing data or that you can afford to lose the pieces of your information if the commands go wrong.
-avs
- All objects, verbose output, do not allow remote shell to interpret characters; in other words, file names with spaces and special characters will not be translated, which is what you want most likely, especially if you have Windows files, too.
--delete
will delete files at the target (destination), if they do not exist in the source. This means you will always keep an up to date list of files and the source and destination will match, plus the destination will not slowly grow in size with older, perhaps irrelevant content.
There are a million, literally. So here's a sampling of good things:
`-l` (lowercase L), when symlinks are encountered, recreate the symlink on the destination.
`--exclude=PATTERN` exclude files matching PATTERN
`--exclude-from=FILE`, read exclude patterns from FILE
`--include=PATTERN`, don't exclude files matching PATTERN
`--include-from=FILE`, read include patterns from FILE
Likewise, the option
--files-from=FILE
allows you to specify a detailed list of directories you wish to include in your backup. Please note that if you write down directory paths without trailing slash (/), they will be recreated blank, and if you do add the trailing slash, their content will also be copied.
For FAT mswindows filesystems
In particular, when transferring to or from a Microsoft Windows FAT filesystem, which represents times with a two-second resolution,--modify-window=1
is useful.
And we check the destination too. You should use the combination of directory and file count and total usage, with commands like du, wc and similar to make sure that you have the exact same information on your target filesystem as the source.
du -hc|sort -k2
comandos
rsync -avvzh -P --progress --stats --exclude '.cache' --exclude 'software' --include 'myscripts' --include 'outros' --include 'mysecrets' --include 'msys' --include 'lssecfixes' . /run/media/ptcpt072/bak2/ibm-t470-rhel7x/