If you are planning on creating incremental or differential backups, you must use the pull method. You can either push the backup to a remote host, or you can pull the backups from the source host to the backup host. There are two methods for remote backups. This is an efficient way to maintain an exact copy of a directory. Remember that –delete will delete any extra files that are in the destination directory, but not the source. If you wish to update a backup, just run rsync again with the same arguments. ls backup/įilea rsync -delete -ah backup/ ls stuff/ Here is an example of restoring a backup with the –delete option. For example, you may have an application that creates temporary or cache files. If you wish to delete files in your destination that aren’t in your source, add the –delete option. Sometimes you will want to backup or restore an exact copy of your data. To restore your backup, reverse the source and destination. With verbose output turned on, rsync will display the transfer speed, a list of files transferred, and the size of the transfer. If you are interested, the man page describes all of the details.įinally, -v turns on verbose output. It instructs rsync to preserve time stamps, permissions, and a few other things. It is a shortcut for several other options. it will display the size of the transfer in KB, MB, etc., instead of bytes. The -h option displays sizes in a human readable format. When the slash is included, just the files in stuff will be copied to backup. Notice how stuff is copied into backup when the trailing slash is left off. In the example, backup will be a clone of stuff. If you leave off the slash after stuff, a directory named stuff will be created in backup. The following example demonstrates backing up a directory named stuff to a directory named backup. To create a local backup, run rsync with the relevant options, source directory, and destination directory. If you are backing up to another directory, removable storage, or a locally mounted network file system, then you will be creating local backups. Rsync can backup files locally or remotely. You can can create full, differential and incremental backups of a directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |