Results 1 to 2 of 2
Ok,
I have a dump sql script that I am running on my database machine right now but the problem is I have to manually run it everyday because I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-19-2007 #1
MySQL Dump script help - Date HASH...
Ok,
I have a dump sql script that I am running on my database machine right now but the problem is I have to manually run it everyday because I have to edit the file to change the dump file name to reflect the current date. I want to know if there is a way to hash the name to grab the system date and use that in the name so that I can run the script via cron... Any help will be appreciated...
This is the outfile part of the script:
I need the file to auto generate the date everyday...SELECT *
INTO OUTFILE "/data/export/06-18-2007_all_user_dump.txt"
-Mike
- 06-19-2007 #2
You're probably best writing a bash script that cron fires off. With this, in the bash script would be something like:
Then run that bash script from the cron job.Code:#!/bin/bash DATE=`date +%d-%m-%Y` SELECT * INTO OUTFILE /data/export/$DATE_all_user_dump.txt
"I am not an alcoholic, alcoholics go to meetings"
Registered Linux user = #372327


Reply With Quote
