Skip to content

Instantly share code, notes, and snippets.


André Rocha andrecgro

View GitHub Profile
andrecgro /
Created Jul 19, 2017
this gist backup a whole folder and database, send it to a dropbox account, and exclude oldest backups, keeping only the two newest
# This script creates a compressed backup archive of the given directory and the given MySQL table.
# After that, saves the compressed file to a folder you named, send it to a dropbox account(assuming that you have dropbox uploader[]),
# and then excludes the oldest files, keeping only the two newest on the server (the dropbox receives ALL files and do not exclude)
# Feel free to use this script wherever you want, however you want.
# Author: André Camargo Rocha(, in June 2017
# Set the date format, filename and the directories where your backup files will be placed and which directory will be archived.
NOW=$(date +"%Y-%m-%d")