Need help setting up a CRON job


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Need help setting up a CRON job
# 1  
Old 11-04-2011
Need help setting up a CRON job

Okay I am not the best at UNIX, so please excuse this if it is a complete ID 10-T error (look at that for a moment...)

Logging in via telnet to the server, I want to create a cron job to run various "canned reports" in SAS on a regular basis. No problem, I have the directories, .profile locations, etc... but actually setting it up is CONFUSING. Smilie

Where do I go to type in the string 01 05 * * 6 <username> <profile> <att1> <att2> type field?

I have run crontab -e <userid> and it shows two jobs my admin set up for me... I hit "i" to insert a new line... but it only inserts one line (the entire command is 4 lines).

Please help me figure this out! And THANK YOU!!!

This is what I am trying to write in:
Code:
00 04 * * 5 ksh -c ". /directory/userid/.profile; nohup /sas_directory/sas /directory/userid/program.sas  -work /localhome/sastmp -log /directory/userid/program.log >/directory/userid/program.log 2>&1

# 2  
Old 11-04-2011
Since the entire command is toooo long as you say, it is a good practice to put such things in shell scripts and add it your cronfile
# 3  
Old 11-04-2011
I'm not quite sure I understand your issue.

The command you've given is only 1 line (albeit a long one) - what are the other 3? Or is it just wrapping on your screen?

You'd probably be better off putting it in a shell script anyway, and just calling the script from cron.

Quote:
Originally Posted by RussellNonBrand
Okay I am not the best at UNIX, so please excuse this if it is a complete ID 10-T error (look at that for a moment...)
It's a WW2 tank gun! Smilie
# 4  
Old 11-04-2011
Knowing what SAS and cron produce the end isn't a good idea also
so your script contains:
Code:
. /directory/userid/.profile; 
nohup /sas_directory/sas /directory/userid/program.sas  -work /localhome/sastmp -log /directory/userid/program.log

And your line :
Code:
00 04 * * 5 <path2yourscript>/script >/directory/userid/cron/program.log 2>&1

# 5  
Old 11-04-2011
Quote:
Originally Posted by CarloM
I'm not quite sure I understand your issue.

The command you've given is only 1 line (albeit a long one) - what are the other 3? Or is it just wrapping on your screen?
It's wrapping on the screen. I start writing it, it gets to the sas directory path (all the paths have at least 4-5 folders), and then returns to the first character of that row.

I have no idea how to write a shell script... or if I even have permission to do such a thing. IT keeps all permissions tightly pinned down at my company.

Quote:
It's a WW2 tank gun! Smilie
Not quite. ID 10-T = IDIOT. Nice way of insulting a "luser" to his or her face and then getting the response, "Oh, I think I've heard of that error!"
# 6  
Old 11-04-2011
And you can also save locally your cronfile:
Code:
crontab -l>mylatest_cronfile

then edit with vi...
And load it again:
Code:
crontab mylatest_cronfile

And so you have a backup... Can be helpful sometimes...
# 7  
Old 11-04-2011
vbe... what do you mean the end isn't a good idea?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

2. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

3. UNIX for Dummies Questions & Answers

Setting up cron

Hi, The client wants to set up cronjob for trigger alerts to be sent between the hours of 6 AM PST and 12 AM PST . Could you please help me the command to setup cron. scriptname :- triggeralert.ksh Thanks in advance (16 Replies)
Discussion started by: kirankumar
16 Replies

4. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

5. UNIX for Dummies Questions & Answers

Setting up More than One Cron Job

Hello, it is possible to setup two cron jobs to run at different frequencies? I have a cron job which runs from monday -friday every 5 mins .I also want to have one more cron job which runs on a sunday.. It it possible to have? Thanks (5 Replies)
Discussion started by: valluvan
5 Replies

6. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

7. Shell Programming and Scripting

setting a cron job

Greetings i am a newbie to this so kindly bear with me. I have a script to get weather information from a site and save that into a database. wget Cranfield Weather Forecast temp = $(cat wx.php | grep -o "Temperature.......") rm wx.php mysql -D "weather_wise" -e "insert into weather... (6 Replies)
Discussion started by: tererez
6 Replies

8. UNIX for Dummies Questions & Answers

CRON usage for CRON job

can anybody explain the usage of CRON for adding a cron job. please provide an example also for better understanding !!! Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

9. Shell Programming and Scripting

cron job setting

hi all I had one script which i had put in /home/name/xxx.sh directory. I want to put it in cron job list means this script must be run on each day at morning 9 am. Kindly reply me all necessary change with exact path detail. Means where i had to do changes. Thanks in adavance. ... (2 Replies)
Discussion started by: jaydeep_sadaria
2 Replies

10. UNIX for Dummies Questions & Answers

setting up cron job for month end week report

Hi all, Needs your help in scheduling a cron job for the below mentioned requirement. Just let me know if anybody has a similar job running as mentioned below: Month end reports - Report of all items created in a parent table that were created during the week. Presently this report runs... (3 Replies)
Discussion started by: Bhups
3 Replies
Login or Register to Ask a Question