I have two shell scripts to write that will be executed nightly via cron schedule.
On my production server:
mysqldump -ufoo -pbar --opt --routines db > ~/sqldump/{$todays_date}.sql
ln -s ~/sqldump/{$todays_date}.sql latest.sql
On my development server:
scp [email protected]:~/sqldump/latest.sql ~/sqldump
mysql -ufoo -pbar db < latest.sql
I have two questions:
- In the production server job, how do i get
$todays_date
to fill in the date? e.g., "2010-07-21" - How do I make step two wait for step 1 to finish in each job?