Skip to content

Instantly share code, notes, and snippets.

@IanSmith123
Last active June 12, 2017 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IanSmith123/6c7af1d4b504e70401a2f0c6bb6acc13 to your computer and use it in GitHub Desktop.
Save IanSmith123/6c7af1d4b504e70401a2f0c6bb6acc13 to your computer and use it in GitHub Desktop.
自动备份mc服务器
#!/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