Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Need help regarding cronjob scheduling Post 302919304 by bakunin on Tuesday 30th of September 2014 09:50:52 AM
Old 09-30-2014
As always with cron scripts: watch out for Cron Problem Number One.

In addition i strongly suggest to add redirections to your crontab entries:

Code:
0,5,10,15,20,25,30 22 * * * /path/to/your/script >/dev/null 2>/dev/null

Otherwise whatever your script produces as output would be sent to you via mail. If you want to preserve any output replace /dev/null with the name of a log file but never have any entry without such a redirection.

I hope this helps.

bakunin

/PS: i prefer using this style of redirection because it is not dependent on order. The following to lines do the same:
Code:
0,5,10,15,20,25,30 22 * * * /path/to/your/script 1>/dev/null 2>/dev/null
0,5,10,15,20,25,30 22 * * * /path/to/your/script 2>/dev/null 1>/dev/null

whereas these two lines produce different results:
Code:
0,5,10,15,20,25,30 22 * * * /path/to/your/script >/dev/null 2>&1
0,5,10,15,20,25,30 22 * * * /path/to/your/script 2>&1 >/dev/null

bakunin
This User Gave Thanks to bakunin For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

regarding the scheduling of the process

Hello, I would like to schedule a command at a specific time on my system.I know that theres a file named at.alow and at.deny in my system. I can find the at.deny file but not an at.allow file . Is there anyway out or i have to go and talk to the system administrator itself , or any other way of... (1 Reply)
Discussion started by: prashantuc
1 Replies

2. UNIX for Dummies Questions & Answers

scheduling

i have tried to schedule my process at a certain time using the at command : the error says bad time specification can somebody help me i used at 2300 job thanks (2 Replies)
Discussion started by: prashantuc
2 Replies

3. Shell Programming and Scripting

script scheduling

Hi, I have a ksh scrip (x) that scans a directory and does actions when a file arrives in this directory. My question is what is the best way to schedule x? 1. Use cron tab and create a task running forever 2. Creat another ksh script (y) that runs (x) in a non-terminating loop Which... (2 Replies)
Discussion started by: GNMIKE
2 Replies

4. HP-UX

cron scheduling?

Hi all, i want a job to run first monday of every of month. (1 Reply)
Discussion started by: megh
1 Replies

5. Programming

Time scheduling

Hello !!! i am trying to create a command scheduler (written in C). Basically i would like to do what the "at" command does , but without using "at" or "cron". I have tried using getitimer but i do not know how can i shcedule multiple commands. Any ideas ??? (2 Replies)
Discussion started by: mcnikolas
2 Replies

6. Linux

Help with cronjob scheduling

Hi Everybody, How to schedule a job using cron that shouldn't run between working hrs 9am-5pm, while run in non working hrs every hour, every day of the month, month & week. I tried the following way, not sure I can use logical not operator(!). Please correct me if wrong or suggest other... (2 Replies)
Discussion started by: sudhirav
2 Replies

7. UNIX for Dummies Questions & Answers

how to cancel a cronjob if the cronjob still running

hi everyone I'm newbie in this forum hope I can get some help here :) I have a command in crontab that executed every 1 minute sometime this command need more than 1 minute to finish the problem is, the crontab execute this command although it's not finish processing yet and causing the system... (7 Replies)
Discussion started by: 2j4h
7 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. Shell Programming and Scripting

Scheduling scheduling !!!

Hi, i have 10 sh scripts. All are running in parallel using cron tab and each script gives "success" flag files once the execution is completed. and, now i have 11th script which should look for "success" flag from those 10 sh scripts. once all the 10 flag files found, 11 th script has to do... (9 Replies)
Discussion started by: nago123
9 Replies

10. Shell Programming and Scripting

Shell script scheduling in cronjob

Hi, I have developed a file deletion script and scheduled it in cronjob to run daily at 5:00 AM. But the script is not running automatically any day. However when I run the script manually at any time, it runs successfully. This is how the cron looks like : 0 5 * * *... (5 Replies)
Discussion started by: jhilmil
5 Replies
SoTimerSensor(3)						       Coin							  SoTimerSensor(3)

NAME
SoTimerSensor - The SoTimerSensor class is a sensor which will trigger at given intervals. Use sensors of this class when you want a job repeated at a certain interval, without explicitly needing to reschedule the sensor (i.e. SoTimerSensor automatically re-schedules itself after it has been triggered). SYNOPSIS
#include <Inventor/sensors/SoTimerSensor.h> Inherits SoTimerQueueSensor. Public Member Functions SoTimerSensor (void) SoTimerSensor (SoSensorCB *func, void *data) virtual ~SoTimerSensor (void) void setBaseTime (const SbTime &base) const SbTime & getBaseTime (void) const void setInterval (const SbTime &interval) const SbTime & getInterval (void) const virtual void schedule (void) virtual void unschedule (void) void reschedule (const SbTime &schedtime) Additional Inherited Members Detailed Description The SoTimerSensor class is a sensor which will trigger at given intervals. Use sensors of this class when you want a job repeated at a certain interval, without explicitly needing to reschedule the sensor (i.e. SoTimerSensor automatically re-schedules itself after it has been triggered). SoTimerSensor instances is commonly used to trigger animation updates at a constant framerate. Constructor &; Destructor Documentation SoTimerSensor::SoTimerSensor (void) Default constructor. Sets up an interval of 1/30th of a second. SoTimerSensor::SoTimerSensor (SoSensorCB *func, void *data) Constructor taking as parameters the sensor callback function and the userdata which will be passed the callback. See also: setFunction(), setData() SoTimerSensor::~SoTimerSensor (void) [virtual] Destructor. Member Function Documentation void SoTimerSensor::setBaseTime (const SbTime &baseref) Set the base trigger time. If you use this method, the trigger times will be on intervals from the given value. Without an explicitly set base time, the next trigger invocation after a trigger has happened will be on the current time plus the interval time. Note that this will of course cause the timer to drift. See also: getBaseTime() const SbTime & SoTimerSensor::getBaseTime (void) const Returns the base trigger time. See also: setBaseTime() void SoTimerSensor::setInterval (const SbTime &intervalref) Sets the time interval between each time the sensor triggers. See also: getInterval() const SbTime & SoTimerSensor::getInterval (void) const Returns the timer trigger interval. See also: setInterval() void SoTimerSensor::schedule (void) [virtual] Overrides the virtual schedule() method to be able to set up the base time, if this was not done by the user. If no base time was set, base time will then equal the current time. See also: unschedule(), isScheduled() Reimplemented from SoTimerQueueSensor. void SoTimerSensor::unschedule (void) [virtual] Overrides the virtual unschedule() method to handle unschedule() calls during triggering. Reimplemented from SoTimerQueueSensor. void SoTimerSensor::reschedule (const SbTime &schedtime) Set new trigger time based on the given schedule time, and schedules the sensor for triggering. Author Generated automatically by Doxygen for Coin from the source code. Version 3.1.3 Wed May 23 2012 SoTimerSensor(3)
All times are GMT -4. The time now is 01:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy