Skip to main content

Ubuntu: Rsync

Ubuntu: Rsync

Rsync is a fast and extraordinarily versatile file copying tool. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. It offers a large number of options that control every aspect of its behavior and permit very flexible specification of the set of files to be copied. It is famous for its delta-transfer algorithm, which reduces the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination. Rsync is widely used for backups and mirroring and as an improved copy command for everyday use.

Rsync is installed in Ubuntu by default. If you need a GUI front-end, install Grsync. It is available in Ubuntu Software Center and also Synaptic package manager.

Usage:
Local backup
sudo rsync -azvv source/ destination/
Remote Backup

sudo rsync --dry-run --delete -azvv -e ssh source remoteuser@remotehost.remotedomain:/path-to-destination/
An explanation of above options to commands:
  • --dry-run This tells rsync to not actually do anything. It will just write a log of what it would do to the screen. Once you've made sure everything will work as you expect, you have to remove this option, and run the command again to perform the actual backup.
  • --delete deletes files that don't exist on the system being backed up.(Optional)
  • -a preserves the date and times, and permissions of the files (same as -rlptgoD).
  • With this option rsync will:
    • Descend recursively into all directories (-r),
    • copy symlinks as symlinks (-l),
    • preserve file permissions (-p),
    • preserve modification times (-t),
    • preserve groups (-g),
    • preserve file ownership (-o), and
    • preserve devices as devices (-D).
  • -z compresses the data
  • -vv increases the verbosity of the reporting process
  • -e specifies remote shell to use 
 Source: Ubuntu Community

Comments

Popular posts from this blog

Ubuntu: Access a usb flash drive from the terminal

    1. Find what the drive is called You'll need to know what the drive is called to mount it. To do that fire off: sudo fdisk -l You're looking for a partition that should look something like:   /dev/sdb1 . Remember what it's called. 2. Create a mount point Create a new directory in   /media   so you can mount the drive onto the filesystem: sudo mkdir /media/usb 3. Mount! sudo mount /dev/sdb1 /media/usb When you're done, just fire off: sudo umount /media/usb Source: StackOverflow

Code for Php based online Treasure Hunt

Hello guys. Some time back I organized an online treasure hunt as part of an event at my college. I thought of sharing the code with you, as you might find it useful. So, I uploaded it on github and here is the link to my repository. Download it from here , and enjoy organizing the game

Create your own custom ROM for any Android device (from XDA)

Don't want to spend time reading? Have a look at the videos here You can find a detailed guide, which keeps on updating in this thread . This guide is for the one who have little experience with Android. Also covers some good advanced topics.