Backup and syncing in terminal using rsync
My first experience with rsync was Synchronizing a directory into two locations on my computer. A program already in the Debian repository is rsync. It’s important to always look and find … Then the questions come.
rsync
rsync is a file transfer program capable of efficient remote update via a fast differencing algorithm. This package generates graphical representations of currently available backups. Graphics for rsync-based backup utility. Backups are stored as complete filesystem trees on a (perhaps external) hard disk. For more see rsync.
pishta@academix2b57:~$ rsync … output truncated Graphics for rsync-based backup utility. Backups are stored as complete filesystem trees on a (perhaps external) hard disk. pishta@academix2b57:~$ apt show rsync rsync is a file transfer program capable of efficient remote update via a fast differencing algorithm. Graphics for rsync-based backup utility. Backups are stored as complete filesystem trees on a (perhaps external) hard disk. Multiple backups use hard links between identical files to save space. Backups may be taken from multiple machines (over SSH) and stored to multiple disks. Backups may be made automatically, i.e. without relying on the operator to remember to make a backup. This package generates graphical representations of currently available backups. Usage: rsync [OPTION]... SRC [SRC]... DEST Options -v, --verbose increase verbosity -a, --archive archive mode; equals -rlptgoD (no -H,-A,-X) -r, --recursive recurse into directories -z, --compress compress file data during the transfer -h, --human-readable output numbers in a human-readable format Usage Usage: rsync [OPTION]... SRC [SRC]... DEST Options (a few) -v, --verbose increase verbosity -a, --archive archive mode; equals -rlptgoD (no -H,-A,-X) -r, --recursive recurse into directories -z, --compress compress file data during the transfer -h, --human-readable output numbers in a human-readable format
Synchronizing a directory into two locations on computer
Source was DebWiki dir from /home/pishta/Desktop (/dev/sda3) în /dev/sda HDD-500 GB.
SRC: /home/pishta/Desktop/ DebWiki Now I had to identify the destination; I chose two destinations on a HDD 1000 GB (/dev/sdb)
DEST – /media/pishta/Backup/ and /media/pishta/49C99121461C0EE3
Identifying locations (DEST)
I used the command lsblk:
pishta@academix2b57:~$ lsblk `NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 465.8G 0 disk ├─sda1 8:1 0 46.6G 0 part / ├─sda2 8:2 0 1.9G 0 part [SWAP] ├─sda3 8:3 0 139.7G 0 part /home ├─sda4 8:4 0 1K 0 part └─sda5 8:5 0 277.6G 0 part sdb 8:16 0 931.5G 0 disk ├─sdb1 8:17 0 465.8G 0 part /media/pishta/49C99121461C0EE3 └─sdb2 8:18 0 465.8G 0 part /media/pishta/Backup sr0 11:0 1 1024M 0 rom
but you may also run command mount:
pishta@academix2b57:~$ mount ... ieșire trunchiată /dev/sdb2 on /media/pishta/Backup type fuseblk (rw,nosuid,nodev,relatime,user_id=0, group_id=0,default_permissions, allow_other,blksize=4096,uhelper=udisks2) /dev/sdb1 on /media/pishta/49C99121461C0EE3 type fuseblk (rw,nosuid,nodev,relatime, user_id=0,group_id=0, default_permissions,allow_other,blksize=4096,uhelper=udisks2)
Final form
The commands for source synchronization in the two destinations will look like these:
rsync -arzhv /home/pishta/Desktop/DebWiki /media/pishta/Backup/ rsync -arzhv /home/pishta/Desktop/DebWiki /media/pishta/49C99121461C0EE3
For now I get it. The need for sure will make me deepen.