Sponsored Content
Top Forums Shell Programming and Scripting How to add a script to Crontab? Post 302497523 by Corona688 on Thursday 17th of February 2011 12:22:42 PM
Old 02-17-2011
Add a line like this:

Code:
0 * * * * /path/to/script.sh

This will tell cron to run /path/to/script.sh on minute 0 of every hour, day, month, and weekday.

If the script doesn't run quite properly from cron, it's probably because cron's default PATH is much more minimal than a user would have, either hardcode a sane PATH in the script (export PATH="...") or read in /etc/profile with . /etc/profile
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how can i use crontab in a script?

hi.. i wolud like to know if it´s possible use the crontab command in my script. the idea is what the script starts automatically, but i don´t know how to do it. please, help me.... thanks jonathan (1 Reply)
Discussion started by: DebianJ
1 Replies

2. Shell Programming and Scripting

Crontab a Script

I know my question maybe eazy, but it realy cause a problem for me I have a Perl script to run and get some output, I run this script using perl /moutaz/ciscolog/telnet.pl I made another script as follow:(/moutaz/ciscolog/script) #!/bin/bash perl /moutaz/ciscolog/telnet.pl cp... (6 Replies)
Discussion started by: moutaz1983
6 Replies

3. Solaris

Add item to crontab

hi, how can I add a new value to crontab file using a script not using the command " crontab -e " . ex: echo " 10 10 * * * " >> /var/spoll/cron/crontabs/<username> how can I do that in a correct way?? thanks, (3 Replies)
Discussion started by: Ahmed waheed
3 Replies

4. Shell Programming and Scripting

How to add cron job in /etc/crontab

Hi, How to add a cron job in /etc/crontab using a shell script.??:confused: Actually the requirement is we need to run a script say, XXX.sh every 10 min through “cron”. That can be achieved by adding the below code line in the /etc/crontab , (i.e., “crontab -e ” command to add this to the... (4 Replies)
Discussion started by: Dedeepthi
4 Replies

5. Solaris

pl script in crontab

Hi I have successfukky created a sh script that runs perfectly well when run. It contains within a pl script that when run through a crontab will not run. Are there restrictions running a pl in cron? (14 Replies)
Discussion started by: rob171171
14 Replies

6. Solaris

cannot add PATH to user crontab file

hi All, here is the problem: I'm not able to specify a PATH inside the user crontab file (/var/spool/cron/crontabs). The only syntax it accepts is the usual "* * * * * file" I'm not able to add PATH, or HOME, or MAILTO, or anything else. when I try to save the crontab, I have the error: ... (1 Reply)
Discussion started by: joe_x
1 Replies

7. Shell Programming and Scripting

crontab script

Hi All, I am running a script to find the CPU and memory utilization of the server. Script name is atul. When i run this script then it gives the desired output as DATE, CPU and MEMORY utilization....as mentioned below: $ $ cat atul A=`date| cut -d" " -f1-4; top -d 1 -n 1 | awk '/^CPU... (5 Replies)
Discussion started by: atulbassi83
5 Replies

8. UNIX for Dummies Questions & Answers

crontab script

Hi guys Can someone help me with a crontab script please? I have to sort the files from /bin and put the first 3 of then (with size and path) in /home/user/bin_size i write the command: find /bin/ | xargs ls -lS | awk 'FNR<4{print($5, $9)}' > /home/user/bin_size which is working but when I... (2 Replies)
Discussion started by: G30
2 Replies

9. UNIX for Dummies Questions & Answers

crontab script

Hi guys Can someone help me with a crontab script please? I have to sort the files from /bin and put the first 3 of then (with size and path) in /home/user/bin_size i write the command: find /bin/ | xargs ls -lS | awk 'FNR<4{print($5, $9)}' > /home/user/bin_size which is working but when... (6 Replies)
Discussion started by: G30
6 Replies

10. UNIX for Dummies Questions & Answers

Crontab in script

I have crontab setup via crontab -e I was wondering if its possible to create a cron job from a script so when the script is run the cron job is created? (3 Replies)
Discussion started by: scriptnewbie
3 Replies
Canto-fetch(1)							    Canto-fetch 						    Canto-fetch(1)

NAME
Canto-fetch - A quiet feed fetcher. DESCRIPTION
Canto-fetch is designed to be run through a cron job, every minute. Every time it's run, it checks the timestamp on each index file and updates the feed, if necessary. The format it produces is a simple UTF-8 encoded, NULL delimited text file on disk, readable by the canto client. GETTING STARTED
Canto-fetch is meant to be used through a cron, adding this line to your crontab will cause canto-fetch to poll every minute. * * * * * canto-fetch Alternatively, if you're unable/uncomfortable using cron, canto-fetch has a background daemon mode so you can invoke it in your X session scripts. Just use canto-fetch -b USAGE
These options correspond to options to the canto client. -h / --help Print usage and quit. -v / --version Print version and quit. -V / --verbose Output status while updating. -d / --daemon Continue to check for updates every minute. Mostly for debugging with -V, users probably want -b to background. -b / --background Detach from the terminal (implies -d) -f / --force Force updates on all feeds, ignoring timestamps. -s / --sysfp Use feedparser on system instead of builtin copy. -C / --conf [PATH] Set path to configuration file (default: ~/.canto/conf) -F / --fdir [PATH] Set path to feed directory (default: ~/.canto/feeds/) -L / --log [PATH] Set path to log (default: ~/.canto/fetchlog) -S / --sdir [PATH] Set the path to execurl scripts (default ~/.canto/scripts/) FILES
~/.canto/fetchlog Canto-fetch log file. ~/.canto/feeds/ This is the directory where canto-fetch records stories. BUGS
None known, but it's not outside of the realm of possibility =P. HOMEPAGE
http://codezen.org/canto AUTHOR
Jack Miller <jack@codezen.org> Version 0.7.10 27 July 2010 Canto-fetch(1)
All times are GMT -4. The time now is 06:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy