Last active
February 17, 2022 06:29
-
-
Save SanjaySRocks/f8031573adb1cf8b121fe0998222e7cf to your computer and use it in GitHub Desktop.
creates backup and upload to website
This file contains hidden or 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 | |
| FOLDER="/var/lib/pterodactyl/volumes/csgo" | |
| BACKUPTIME=`date +%b-%d-%y` | |
| TARFILE='pugbackup_'${BACKUPTIME}'.tar.gz'; | |
| tar -cvzf $FOLDER/$TARFILE $FOLDER/addons $FOLDER/cfg $FOLDER/materials $FOLDER/sound $FOLDER/mapcycle.txt $FOLDER/maplist.txt | |
| if [ -f "$FOLDER/$TARFILE" ]; then | |
| sshpass -p 'password' rsync -aP $FOLDER/$TARFILE [email protected]:/root/backups/ && rm $FOLDER/$TARFILE | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment