Computing.Net > Forums > Solaris > crontab help needed

crontab help needed

Reply to Message Icon

Original Message
Name: simpsoro
Date: September 9, 2005 at 09:54:51 Pacific
Subject: crontab help needed
OS: 5.9
CPU/Ram: 8 GB
Comment:

I am having some trouble setting a command to execute in crontab.

I am doing a crontab -e "username" to edit the cron entries for the user I want. I know how to add in minutes, hours, month etc.

The problem I am having I guess is with the proper syntax of the command I want to execute.

I have a command that resides at: /global/web/web/web/generic/admin

The command I run manually from that directory daily is:
./batch.pl --backup -p '(^[A-Za-z0-9_])'

What would be the proper syntax to add that command to a cron job?


Report Offensive Message For Removal


Response Number 1
Name: nails
Date: September 9, 2005 at 13:02:40 Pacific
Reply: (edit)

Why don't you create a script like this:

# mybackup.ss script
# whatever your shell is
#!/bin/ksh

export PATH=... # whatever your path is when you run from the command line
cd /global/web/web/web/generic/admin
./batch.pl --backup -p '(^[A-Za-z0-9_])'
# end script


Report Offensive Follow Up For Removal

Response Number 2
Name: nz_boy
Date: September 18, 2005 at 15:13:36 Pacific
Reply: (edit)

here ya go man


* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week
( 0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: crontab help needed

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 6 Days.
Discuss in The Lounge