Last active
June 12, 2017 07:37
-
-
Save IanSmith123/6c7af1d4b504e70401a2f0c6bb6acc13 to your computer and use it in GitHub Desktop.
自动备份mc服务器
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
filename=$1 | |
new=mc-back-2017$filename.tar.gz | |
echo "start zip $new" | |
cd ~ | |
tar -czf $new mc/* | |
echo "finish $new" | |
echo "start scp $new" | |
mv $new ~/mc-back/ | |
scp ~/mc-back/$new root@xx.xx.xx:/root/backup_mc/ | |
cd - | |
echo 'EOF' | |
# try ./backup.sh 06121533 to backup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment