Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Scheduling a batch run

Original Message
Name: simflex
Date: March 15, 2007 at 08:15:47 Pacific
Subject: Scheduling a batch run
OS: unix
CPU/Ram: 2g
Model/Manufacturer: don't know
Comment:
We have about 50 scripts that we run everyday.

How can we schedule this script to run automatically on the 5th of every month?

I can provide info if needed.

Thanks in advance


Report Offensive Message For Removal


Response Number 1
Name: nails
Date: March 15, 2007 at 08:49:38 Pacific
Subject: Scheduling a batch run
Reply: (edit)
The unix cron utility is typically used to execute schedule jobs. Consider the contents of myfile:

0 0 5 * * /path/to/myscript

The myscript script now executes at midnight on the 5th.

Make sure that myscript contins the shell you want to execute since cron uses /bin/sh by default. Also, make sure myscript has PATH set.

This command sets cron for whatever user you are logged in as:

crontab < myfile

overwrites any previous cron.

Off topic: If you have scripts that share resources, you might check out:

http://www.samag.com/documents/s=92...


Report Offensive Follow Up For Removal

Response Number 2
Name: simflex
Date: March 15, 2007 at 11:38:10 Pacific
Subject: Scheduling a batch run
Reply: (edit)
Thank you so much for your response.

Can I follow up, please?

You said:
>>Make sure that myscript contins the shell >>you want to execute since cron >>uses /bin/sh by default. Also, make sure >>myscript has PATH set.

How do I get shell and how do I ensure it?

Please be patient. I am a web developer and this just got dropped on my laps because the current owner of the project left.

thanks again



Report Offensive Follow Up For Removal

Response Number 3
Name: nails
Date: March 15, 2007 at 12:11:20 Pacific
Subject: Scheduling a batch run
Reply: (edit)
OK, some lazy shell programmers don't place in the script which shell they are using; they rely on how their environment is set which might be different from the cron utility.

On the first line of the shell script in the first column, you should see this line if it's a bourne script:

#!/bin/sh

If it is a korn shell script:

#!/bin/ksh

Take a look here for a comprehensive list of available shells:

http://www.allcommands.com/samples/...

The second thing I mentioned was PATH.

If your scripts are running correctly at the command line, check your PATH variable:

echo $PATH

Make sure the PATH is set within the scripts that will be run from cron:

PATH=...
export PATH


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: Scheduling a batch run

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




how to setup call of duty to joytok

WindowsME / HotMail Problem

Corrupt memory

Convert fat32 to Ntfs

Best WinMo phone of 2008


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC