Koozali.org: home of the SME Server
Legacy Forums => General Discussion (Legacy) => Topic started by: Rien on July 31, 2005, 12:39:33 AM
-
I want to make a backup of several databases on a daily basis.
I use te command:
mysqldump --add-drop-table --databases DB1 DB2 > /backup/directory/backup.sql
Is there a way to insert the date/time in the name of the backup file?
-
You could try creating a cron file with
#!/bin/sh
date=date -I
mysqldump --add-drop-table --databases DB1 DB2 > /backup/directory/$date-backup.sql
-
Thanks, that did the trick.
Do you know how I can remove the "?" at the end of the datestring?
-
Hi!
Not really sure with "?" at the end of datestring...
[root@XXXXXX]# date -I
2005-07-31
Check your script so you don't have a typo...
Your backup file should have the name
2005-07-31-backup.sql
-
Hi,
The code:
[root@XXXXXX]# date -I
2005-07-31
works fine but when I put that in the script is displays:
2005-07-31?-backup.sql
My script is:
date=date -I
mysqldump --add-drop-table --databases home fczc4 > /home/e-smith/files/ibays/software/files/backup/$date-backup.sql
Strange isn't it?
-
Try this one... You can modify the date format as you wanted by simply modifying parameters for day, month and year
#!/bin/bash
DATE=date +%d-%m-%y
mysqldump --add-drop-table DBNAME > backup-$DATE.sql
gzip --best backup-$DATE.sql
Output should be
backup-31-07-05.sql.gz
-
Hi,
I tried that but I get the same "?" after the date in the filename.
Can it be I have an old version. I use version 2.0.11 (sh-utils) which is part of SME-server 6.0.1-1.
-
That was intreseting... :-?
I have NO idea why you get "?"...
PS: It's not because of sh-utils, I have the same version.
-
I tried different options now but without success.
-
Hi All,
I want to Backup some of MYSQL DB's in SME 6.X Server. Is their any GUI interface for backup?
Can i connect any windows mysql backup software to backup these db's if so how?
Thanks
-
Hi Cosy,
I use "PHPMyAdmin" to make backups. You can select DB's and tables and export them.
-
Hi there,
The is a handy web based DB backup utility at http://www.phpmybackuppro.net/. I use this on other servers and it works great. Haven't tried it on SME yet though.
Arthur
-
Hi,
Can you install into SME and tell me the steps pls
-
Hi,
Never installed onto SME before but I'll give it a try and get back to you. Meanwhile, the help file included is pretty straight forward if you wann have a go yourself.
Arthur
-
Hi.
It has been mentioned before - automysqlbackup. (http://sourceforge.net/projects/automysqlbackup/)
Very simple data base backup utility - that works well.