[Solved] crontab scheduling


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers [Solved] crontab scheduling
# 1  
Old 02-25-2012
[Solved] crontab scheduling

Hi,

We can schedule a new job using
Code:
crontab -e

.
is there any other way to achieve the same(opening the file directly and add an entry).
I have tried to access /var/spool/crontabs directory. But i am getting permission denied error,
Please help me. Thanks
# 2  
Old 02-25-2012
What user ID are you using? Only root can set/edit other user's cron job. Also, there are two file in /etc directory for permitting and denying access to cron job. Those are cron.allow and cron.deny.

Post details please.
# 3  
Old 02-25-2012
I am using my Id only . I am trying to change my scheduled jobs only .
I am able to do this via
Code:
crontab -e

# 4  
Old 02-25-2012
Assuming you are using Linux distro, /var/spool/cron has permission only for root user, others are denied:

Code:
$ ls -ld /var/spool/cron
drwx------. 2 root root 4096 Feb 25 14:06 /var/spool/cron

Use crontab -e. If you are not used to using vi editor, change the EDITOR shell environment variable to whatever editor you like:

Code:
export EDITOR=/usr/bin/nano

# 5  
Old 02-25-2012
All files in /var/spool/cron/crontabs are owned by root...
But nothing is stopping you to:
Code:
crontab -l >my.cronfile
vi my.cronfile #edit and modify to your needs...
crontab my.cronfile

This User Gave Thanks to vbe For This Post:
# 6  
Old 02-25-2012
But my intention is to create a shel script and adding new schedules via the scriPt.
It seems it's not possible to achieve that
# 7  
Old 02-26-2012
Paste output of following file:

Code:
 # ls -ld /etc/cron.allow

# ls -ld /etc/cron.deny

Can you edit the sudoers file?

Code:
# visudo

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

[Solved] Error while updating the crontab

When I update the crontab, I get error message. Any idea? 0 0-23 * * * /usr/local/scripts/monitor.sh > /dev/null ( BEFORE) */5 * * * * /usr/local/scripts/monitor.sh > /dev/null (Now) it doesn't allow me to save the work. Error message... crontab: */5 * * * *... (3 Replies)
Discussion started by: samnyc
3 Replies

2. Shell Programming and Scripting

Crontab Scheduling

I want to schedule a job as - Every Weekday at 12:30 PM and 9 PM in a single line. How can i do that (2 Replies)
Discussion started by: varlax
2 Replies

3. UNIX for Dummies Questions & Answers

[Solved] Crontab

Hi I need my script to run at 7:30, 7:40, 7:50 & 8:00 AM. Defined like: 30,40,50 7,8 * * * sh myscript.sh But this runs even at 8:30, 8:40, 8:50 - which I don't need.. Please advise. (4 Replies)
Discussion started by: ashokvpp
4 Replies

4. Shell Programming and Scripting

[Solved] Shell script not working in crontab

Hi Iam running below script in crontab but its not working. #!/bin/sh cd /Scripts /usr/local/bin/expect -f /Scripts/bng_backup.exp /Scripts/data.txt tar -cf bngbackup.tar bngbackup ;gzip bngbackup.tar when iam running manually the output file is generating..but bngbackup.tar.gz file... (5 Replies)
Discussion started by: surender reddy
5 Replies

5. UNIX for Advanced & Expert Users

[Solved] Crontab not launching script

Hi all, i have the following script #!/bin/sh for i in `ps -leaf --cols 1024 | grep LogUser | grep -v grep | awk '{print $4}'`; do echo $i kill -15 $i; done; but it seems that the crontab its sciping this script,i configured corntab as following */30 * * * root... (2 Replies)
Discussion started by: charli1
2 Replies

6. UNIX for Dummies Questions & Answers

Scheduling a script by using Crontab

Hi, I need to schedule a script in crontab which should run at 01:00 am in the morning and should run for every 15 days in a month. How to schedule this by using crontab? Many thanks. Rgds, (13 Replies)
Discussion started by: venkatesht
13 Replies

7. HP-UX

[Solved] crontab issue "day of week"

Is there an issue with running a cron entry like the below entries? 0 2 21 12 2 cd /usr/local/bin;./cksecurity.sh -f /home/theninja/security.dat21 I wanted this to run on Tues at 2am, which it did successfully, however I also had the following entry to run next tuesday that also ran on 12/21.... (3 Replies)
Discussion started by: theninja
3 Replies

8. Shell Programming and Scripting

Crontab scheduling

Hi all, My OS is Solaris 10. I want to schedule a job which i need to run between morining 6 to eve 6 once for every 2 hours. This is what i did. 0 6-18 * * 1-5 /monitor.sh It runs for every hour how to make it for every two hours ...... Thanks, Firestar. (1 Reply)
Discussion started by: firestar
1 Replies

9. UNIX for Advanced & Expert Users

Scheduling a script other than crontab

Hi, How can we run/schedule a shell script. Since there is no access to cron at this point of time we have to think other way out to run a script every hour. How can we achieve this. Need advice. How about using sleep,autosys etc...the script should trigger off every hour...which sends... (3 Replies)
Discussion started by: noorm
3 Replies

10. Shell Programming and Scripting

Scheduling crontab using parameter from XML file

Hi, I need to write script which will read a value from XML file and schedule crontab accordingly. I have an XML file which has a key value structure where the entries is: <Param Name="executionInterval" Value="600" /> 600 means that the crontab should be scheduled to run every 600 sec. ... (0 Replies)
Discussion started by: michaelbz
0 Replies
Login or Register to Ask a Question