Backup of Linux commands

 

dump -0aj -f /tmp/home0.bak /home makes a full backup of the '/home' directory

 

dump -1aj -f /tmp/home0.bak /home makes an interactive backup of the '/home' directory

 

restore -if /tmp/home0.bak restores an interactive backup

 

rsync -rogpav --delete /home /tmp synchronize directories on both sides

 

rsync -rogpav -e ssh --delete /home ip_address:/tmp rsync over SSH tunnel

 

rsync -az -e ssh --delete ip_addr:/home/public /home/local Sync a remote directory to a local directory via ssh and compression

 

rsync -az -e ssh --delete /home/local ip_addr:/home/public Sync local directory to remote directory via ssh and compression

 

dd bs=1M if=/dev/hda | gzip | ssh user@ip_addr 'dd of=hda.gz' performs an operation of backing up the local disk on the remote host through ssh

 

dd if=/dev/sda of=/tmp/file1 backup disk contents to a file

 

tar -Puf backup.tar /home/user performs an interactive backup of the '/home/user' directory

 

( cd /tmp/local/ && tar c . ) | ssh -C user@ip_addr 'cd /home/share/ && tar x -p' copy a directory content in a remote directory via ssh

 

( tar c /home ) | ssh -C user@ip_addr 'cd /home/backup-home && tar x -p' to copy a local directory in a remote directory via ssh

 

tar cf - . | (cd /tmp/backup ; tar xf - ) Copy a directory locally to another, preserving the original permissions and links

 

find /home/user1 -name '*.txt' | xargs cp -av --target-directory=/home/backup/ --parents Find and copy all files ending with '.txt' from one directory to another

 

find /var/log -name '*.log' | tar cv --files-from=- | bzip2 > log.tar.bz2 Find all files ending with '.log' and make a bzip package

 

dd if=/dev/hda of=/dev/fd0 bs=512 count=1 Do an action to copy the MBR (Master Boot Record) content to the floppy disk

dd if=/dev/fd0 of=/dev/hda bs=512 count=1 restore MBR contents from a backup already saved to floppy

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326073410&siteId=291194637