Skip to content

Instantly share code, notes, and snippets.

@SanjaySRocks
Last active February 17, 2022 06:29
Show Gist options
  • Select an option

  • Save SanjaySRocks/f8031573adb1cf8b121fe0998222e7cf to your computer and use it in GitHub Desktop.

Select an option

Save SanjaySRocks/f8031573adb1cf8b121fe0998222e7cf to your computer and use it in GitHub Desktop.
creates backup and upload to website
#!/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