Advertisement
iKernel

MEGA Backup

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