cp file.sql.gz to file-02-17.2017.sql.zip
Moderator: General Moderators
cp file.sql.gz to file-02-17.2017.sql.zip
I use Ubuntu for want of a distribution for my database, I was wondering if anyone knows how to name a file to the date so that backups can be accumulated over time
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
My site is powered by LAMP
Re: cp file.sql.gz to file-02-17.2017.sql.zip
How are you doing the backups? If there's a shell command involved then you may be able to add a
in it to inject the date at that location, eg.
Code: Select all
`date +'%m-%d-%Y'`Code: Select all
mysqldump ... > backup-`date +'%m-%d-%Y'`.sqlRe: cp file.sql.gz to file-02-17.2017.sql.zip
By mechanizing backups with a BASH script and cron, then I can go back as needed in case of a disaster
I am sure anyone reading this post will see the immediate benefit to backup of the backup
add the script and voila, aged backups, then I can download with FTP and have safe backup in case something gets bricked
Code: Select all
sudo mysqldump -u root -p --all-databases | gzip > backup-`date +'%m-%d-%Y'`.sql.gzCode: Select all
sudo crontab -eHardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
My site is powered by LAMP