dotfiles/bin/backmeup

14 lines
513 B
Plaintext
Raw Normal View History

2020-10-27 21:06:46 +01:00
#!/bin/sh
datum=$(date +"%y-%m-%d")
2020-11-11 00:16:56 +01:00
backuplog=/root/backup-log
2020-10-27 21:06:46 +01:00
2023-07-02 22:58:10 +02:00
sudo sshfs pi@pi:/home/pi/mast/bak/pbp /root/.bak
2020-11-11 00:16:56 +01:00
2023-07-02 22:58:10 +02:00
#borg create -svp pi@pi:~/mast/bak/pbp::$datum /etc /home /opt /root /srv /var | sudo tee -a $backuplog
2020-11-11 00:16:56 +01:00
echo "Backup sistema $datum" | sudo tee -a $backuplog
2021-09-29 21:48:08 +02:00
#rsync -avz /etc /home /opt /root /srv /var pi@pi:~/mast/bak/tp | tee -a $backuplog
sudo borg create --stats --verbose --compression=lz4 "/root/.bak::$datum" /etc /home /opt /root /srv /var | sudo tee -a $backuplog
2020-11-11 00:16:56 +01:00
2021-09-29 21:48:08 +02:00
sudo umount /root/.bak