Advertisement
Monarch73

linux system backup

Aug 15th, 2016
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 KB | None | 0 0
  1. #!/bin/bash
  2. mkfs.ext4 /dev/sda1
  3. mount /dev/sda1 /mnt/backup
  4. #rsync -aAXvHS --numeric-ids --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /mnt/backup/
  5. tar -czvf /mnt/backup/back`date +%Y-%m-%d`.tar.gz / --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/tmp --exclude=/run --exclude=/mnt --exclude=/media --exclude=/lost+found
  6. umount /mnt/backup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement