Subject: Cron Job... Urgent
Posted By: ganesh15 Post Date: 8/28/2003 1:47:35 AM
I have to do a cronjob on linux box.

The process are as below:

1. Cron job should dump postgres database to file.

2. Tar the dump file.

The problem is the database dump will take about 1 hour to dump complete.

The tar should take place once the dump is completely finish.

How do I make sure tar of the file takes place's after the database dumped completely?  

Please help, its really urgent.

Regards,
ganesh



Reply By: 3razZz3r Reply Date: 9/18/2003 9:10:21 PM
I think this should be quite simple.

Put all the commands in the script.  Use cron to execute the script.
The execution should be serially unless you append "&" at the end of the command.
Reply By: dikkjo Reply Date: 9/19/2003 1:40:29 AM

To be sure :

pg_dump your_db > your_file && tar zcf your_tar.gz your_file


Using '&&' only execute the second command if the first one was successfully completed.

HIH
Bye

Go to topic 4302

Return to index page 1043
Return to index page 1042
Return to index page 1041
Return to index page 1040
Return to index page 1039
Return to index page 1038
Return to index page 1037
Return to index page 1036
Return to index page 1035
Return to index page 1034