Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Automated SAMP backups to MEGA - iKernel
- # -*- ENCODING: UTF-8 -*-
- # You MUST have installed MegaCMD on your Linux OS. MegaCMD works with GOLang (apt-get install golang)
- # If error: tr -d '\r' <script> output_script
- echo Creating SQL file from database...
- cd /home/
- mysqldump -u root [MySQL Password] [MySQL Database name] > backup_`date +%F_%H`.sql
- echo Uploading to MEGA...
- /usr/local/bin/megacmd mkdir mega:/bk_`date +%F_%H`/
- /usr/local/bin/megacmd put /home/server_log.txt mega:/bk_`date +%F_%H`/
- /usr/local/bin/megacmd put backup_`date +%F_%H`.sql mega:/bk_`date +%F_%H`/
- rm backup_`date +%F_%H`.sql
- echo Backup uploaded successfully
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement