a database as often as you wish.
DATABASE BACKUP
Mnemonic: DB
Syntax:
DB
Create a backup copy of the active Rivendell database in
On my set up I made a new macro called back up database. It has only 2
lines in it.
DB /home/geoff/Downloads/RivendellBackUp/RD-Backup.sql!
RN /home/geoff/Downloads/RivendellBackUp/datestamp.sh!
The first line makes a new sql file called RD-backup.sql
The second line runs a shell script that renames the backup sql file
to the current day's date.
#!/bin/bash
#Special program to rename the current database back up with todays date.
sleep 30
mv ~/Downloads/RivendellBackUp/RD-Backup.sql
~/Downloads/RivendellBackUp/RD-$currentdate.sql
currentdate=`date +%F-%X`
echo $currentdate
mysqldump -u rduser -pletmein --lock-tables=false Rivendell > /home/geoff/rivendell-backup/RD-$currentdate.sql
You can set up this macro to run daily weekly or whenever.
No comments:
Post a Comment