Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- stamp=$(date "+%F-%T")
- mcDir=$(pwd)
- echo 'Enter the directory to where you want to back the server up (full path required)'
- read backupDir
- echo Beginning backup process
- if [ -d ''$backupDir'' ]
- then
- echo Compressing the server directory...
- tar -zcvf $backupDir/$stamp.tar.gz $mcDir
- else
- echo 'Creating directory '$backupDir' since it does not already exist'
- mkdir -p $backupDir
- echo Now to compress the server directory
- tar -zcvf $backupDir/$stamp.tar.gz $mcDir
- fi
- echo Backup complete. Exiting...
Add Comment
Please, Sign In to add comment