Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Linux
| Search | Today's Posts | Mark Forums Read
Linux General discussion of programming the various flavors of Linux operating systems.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Linux section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 28th, 2003, 01:47 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cron Job... Urgent

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



  #2 (permalink)  
Old September 18th, 2003, 09:10 PM
Registered User
 
Join Date: Sep 2003
Location: , , Philippines.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
  #3 (permalink)  
Old September 19th, 2003, 01:40 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Switzerland.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default


To be sure :
Code:
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Job mani_he Linux 4 December 16th, 2010 07:02 AM
Windows cron job hsauer VB How-To 0 August 9th, 2006 11:40 AM
Cron Job Error - Need Help jkirkpatrick Linux 2 August 5th, 2005 05:51 AM
Cron job error ganesh15 Linux 1 October 22nd, 2003 04:04 AM
Cron job for a php-file nineball9 PHP How-To 2 October 21st, 2003 04:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.