1833748 Members
2819 Online
110063 Solutions
New Discussion

Re: Cron entry

 
Prashant Zanwar_4
Respected Contributor

Cron entry

00 3 * * 1-6 /usr/tools/mcsg/package_check ip_ecust "$(/usr/local/tools/backup/ecprd-bcv_online_merge_split) && $(/usr/local/tools/backup/ecprd-rdf_merge_split)" >/var/log/backup_ecustomer.log 2>&1

While I put above entry, part after && is skipped? any clue?
Thx
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
9 REPLIES 9
Rick Garland
Honored Contributor

Re: Cron entry

There are 2 separate commands.
Can you combine them?
Prashant Zanwar_4
Respected Contributor

Re: Cron entry

No cant combine those.
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
Prashant Zanwar_4
Respected Contributor

Re: Cron entry

This is basically a backup job. 2nd depends on 1st.
R1 > R1/BCV > R2. It has to be that way. SO please let me know any way to do it.
Thx
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
MarkSyder
Honored Contributor

Re: Cron entry

Combine them into a single shell script with the command "wait" separating the two main commands. That will ensure the system waits for the first command to finish before it runs the second.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Rick Garland
Honored Contributor

Re: Cron entry

If there is a dependency, have the 1st part of a script return a value and if that value is successful then execute the 2nd part.
D Block 2
Respected Contributor

Re: Cron entry

one suggestion might be to enclose using open-braces to the shell:

package_check_ip_ecust ( x && y ) > outfile.

my thinking is, if you can type this in the shell, it might do the trick via cron line, too. Example: type-in at your prompt:

( date && date )

Golf is a Good Walk Spoiled, Mark Twain.
Pedro Cirne
Esteemed Contributor

Re: Cron entry

Hi,

You can use the "serialize" command to run one processe after another. Check the man pages.

Enjoy :-)
Geoff Wild
Honored Contributor

Re: Cron entry

I don't think you can do it that way...

For example, when I:

3,8,13,18,23,28,33,38,43,48,53,58 * * * * [ -d /var/adm/lp/XEBEC ] && /usr/local/bin/mrtg-stats >/dev/null 2>&1


It will only execute after the && if /var/adm/lp/XEBEC exists...

The && is a conditional - and you are not providing a condition...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Prashant Zanwar_4
Respected Contributor

Re: Cron entry

As of now i just tested with test scripts in ( ) braces..looks alright..WIll update more
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."