Skip to content

Instantly share code, notes, and snippets.

@miftahafina
Created April 10, 2018 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miftahafina/f78475b405eb1edf00bcd5f8b2bf0418 to your computer and use it in GitHub Desktop.
Save miftahafina/f78475b405eb1edf00bcd5f8b2bf0418 to your computer and use it in GitHub Desktop.
Simple Backup Script
#!/bin/bash
# Backup htdocs
tar -cvzf ~/Backup/Files/htdocs-$(date +%d).tar.gz /opt/lampp/htdocs
# Backup database
/opt/lampp/bin/mysqldump -u [user] -p[password] --all-databases > ~/Backup/Files/semua_database-$(date +%d).sql
// crontab -e
// 0 23 * * * sh /home/app/Backup/Script/backup_script.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment