30 lines
853 B
Bash
30 lines
853 B
Bash
#!/bin/bash
|
|
|
|
# Show help page
|
|
if [ "$1" = "-h" ]
|
|
then
|
|
echo "system-backup <option>"
|
|
echo
|
|
echo "If no options are specified it will use default"
|
|
echo
|
|
echo "Options:"
|
|
echo
|
|
#echo "-d [USB Dir]"
|
|
echo
|
|
echo
|
|
exit 0
|
|
fi
|
|
|
|
# Initialize variables
|
|
#backup_dir="/mnt/USB/Backup/"$(date +'%Y/%m/%d')
|
|
backup_dir_remote="/media/backup/games/"$(date +'%Y/%m/%d')
|
|
minecraft_dir="/media/games/bukkit"
|
|
csgo_dir="/var/"
|
|
remote_ip="192.168.178."
|
|
|
|
# Back the fuck up bro...
|
|
sudo ssh backup@$remote_ip sudo mkdir -p $backup_dir_remote/mc mkdir $backup_dir_remote/csgo
|
|
# copy the shit over
|
|
sudo screen -dmS backup -t backup bash -c "rsync -Aavr --progress -e ssh $minecraft_dir backup-user@$remote_ip:$backup_dir_remote/mc;
|
|
rsync -Aavr --progress -e ssh $csgo_dir backup-user@$remote_ip:$backup_dir_remote/csgo;
|
|
" |