How to setup cronjob 3rd sunday of every month?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to setup cronjob 3rd sunday of every month?
# 8  
Old 10-30-2014
Thanks Ravindera, Rudic
I tried something this to run the script on above situation and kept cron job like this but this is not working .can anyone Please help me here .or how to test this if it is not working from the cron job.

Code:
55 03 * * * [ `date +%d` -eq `cal | nawk 'NR==4 {i=(NF<7)?1:0}NR==(7+i){print $5}'` ] &&  sh /home/nz/TEST/test_cronjob.sh  >> dev/null }

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

cron job on 3rd sunday of every month

Hi, Actually scheduled my test scripts on test severs as shown below. They are supposed to run on 3rd sunday of every month. Unfortunately it ran on 2nd sunday of the month (suspecting that it will run every sunday). I am sorry if I miss something. Could you please let me know if I did any... (1 Reply)
Discussion started by: System Admin 77
1 Replies

2. Shell Programming and Scripting

Run script on every last sunday of the month

Hi ALL, I have been testing this script to run for every last Sunday of the month,looks like month which have 5 sunday (july 2016 )is not passing this and failing every time. Here is what I am using, current_date=31 echo " CURRENT DAY -> $current_date" if ... (2 Replies)
Discussion started by: netdbaind
2 Replies

3. Shell Programming and Scripting

Trigger the script if it is first sunday of the quarterly month

Hello All, I have script which needs to be scheduled in crontab which needs to be run only on the first sunday of the quarterly months (March, June, September,Dec). Can anyone please help me out on this. Thanks, Arun. (13 Replies)
Discussion started by: Arun1992
13 Replies

4. UNIX for Dummies Questions & Answers

How to create a cronjob for the 3rd business day of every month?

Hello, Can you please help me out in creating a cronjob that runs every 3rd business day of the month. Thanks (2 Replies)
Discussion started by: AReddy
2 Replies

5. Shell Programming and Scripting

How to get first sunday of the month?

Hi, Please can someone help me in getting first sunday date of a month. i_year=`date +%Y` ny_first_sun_nov=`cal 10 $i_year | sed '/^$/d' |head -3 |tail -1| rev | cut -c1` This works good if the first sunday has a value but not if it is blank and first sunday falls on second week. ... (17 Replies)
Discussion started by: infyanurag
17 Replies

6. UNIX for Dummies Questions & Answers

[Solved] Cron - job to run every 3rd Friday of the month only

Hi Expert Please help me to set a cron job schedule, Ihave a job that run every 3rd Friday of the month at 1030am. I tried to set up like this, but the job still runs every friday at 1030am. I want the job to run every 3rd Friday of the month at 1030am only 30 10 15,16,17,18,19,20,21... (2 Replies)
Discussion started by: kaibiganmi
2 Replies

7. Solaris

Cronjob doesnot exist on the machine but running every sunday

I have deleted a particular cronjob couple of months ago but the jb is still running every sunday, even though it is not present in /var/spool/cron/crontabs/root file. Please assist. (6 Replies)
Discussion started by: prash358
6 Replies

8. Shell Programming and Scripting

crontab: setup cronjob to run first wednesday of every month

Hi, How to setup cronjob to run first wednesday of every month. Is there a way? Thanks.. (9 Replies)
Discussion started by: Anjan1
9 Replies

9. UNIX for Dummies Questions & Answers

How to Set up a cronjob On 4th Sunday of every Month?

How to Set up a cronjob which will run On 4th Sunday of every Month at 8:00 PM :( (11 Replies)
Discussion started by: tp2115
11 Replies

10. UNIX for Dummies Questions & Answers

Cron job -- to execute at every first Sunday of every month

Dear all How can I schedule the cronjob to be run sometime at every first Sunday at every month? I have the edit the cronjob every month now, thanks (2 Replies)
Discussion started by: shanemcmahon
2 Replies
Login or Register to Ask a Question
shevek::absolute_time(3)				     Library Functions Manual					  shevek::absolute_time(3)

NAME
shevek::absolute_time - The absolute_time class stores a date and time. SYNOPSIS
#include <time.hh> Public Member Functions absolute_time () Create a new absolute_time containing the current time. absolute_time (unsigned years, unsigned months, unsigned days, unsigned hours, unsigned minutes, unsigned seconds, unsigned nanoseconds=0) A specific time. absolute_time (timetype seconds, unsigned nanoseconds) Fast constructor. absolute_time operator+ (relative_time that) const Add an interval to this moment. absolute_time operator- (relative_time that) const Subtract an interval from this moment. relative_time operator- (absolute_time that) const Compute the interval between two moments. absolute_time & operator+= (relative_time that) Add an interval to this moment. absolute_time & operator-= (relative_time that) Subtract an interval from this moment. bool operator< (absolute_time that) const Compare two moments. bool operator> (absolute_time that) const Compare two moments. bool operator<= (absolute_time that) const Compare two moments. bool operator>= (absolute_time that) const Compare two moments. bool operator== (absolute_time that) const Compare two moments. bool operator!= (absolute_time that) const Compare two moments. unsigned nanoseconds () const Get the nanoseconds. unsigned local_second () const Get the seconds in local time. unsigned local_minute () const Get the minutes in local time. unsigned local_hour () const Get the hour in local time. unsigned local_days () const Get the day of the year in local time, range 0-365. unsigned local_day () const Get the day of the month in local time, range 1-31. unsigned local_weekday () const Get the day of the week in local time, range 0-6 where 0 means sunday. unsigned local_month () const Get the month in local time, range 1-12. unsigned local_year () const Get the year in local time. unsigned second () const Get the seconds in UTC. unsigned minute () const Get the minutes in UTC. unsigned hour () const Get the hour in UTC. unsigned days () const Get the day of the year in UTC, range 0-365. unsigned day () const Get the day of the month in UTC, range 1-31. unsigned weekday () const Get the day of the week in UTC, range 0-6 where 0 means sunday. unsigned month () const Get the month in UTC, range 1-12. unsigned year () const Get the year in UTC. timetype total () const Total number of seconds since january 1970, as encoded. sigc::connection schedule (sigc::slot0< void > callback, Glib::RefPtr< Glib::MainContext > context=Glib::MainContext::get_default()) Schedule a callback at a certain time. Static Public Member Functions static absolute_time create_from_local (unsigned years, unsigned months, unsigned days, unsigned hours, unsigned minutes, unsigned seconds, unsigned nanoseconds=0) Semi-constructor which creates a new absolute_time given a date in local time. static void set_digits (unsigned num) Set number of digits to use when printing (for fractions of seconds) static unsigned get_digits () Get the number of digits which is used when printing. Friends sigc::connection schedule (sigc::slot0< void > callback, int prio, Glib::RefPtr< Glib::MainContext > context) Schedule a callback for when the main loop has time. std::ostream & operator<< (std::ostream &s, absolute_time t) Write the time to a std::ostream. Detailed Description The absolute_time class stores a date and time. Everything is in UTC, except the output of local_* (); Constructor &; Destructor Documentation shevek::absolute_time::absolute_time () Create a new absolute_time containing the current time. Note that this makes a call to gettimeofday, which is much slower than specifying seconds and nanoseconds. Thus, if you need an absolute_time object to fill with an actual time later, use absolute_time foo (0, 0); instead of this default constructor. shevek::absolute_time::absolute_time (unsignedyears, unsignedmonths, unsigneddays, unsignedhours, unsignedminutes, unsignedseconds, unsignednanoseconds = 0) A specific time. days may be 0-365, with months 0. If months > 0, both days and months have a base of 1. shevek::absolute_time::absolute_time (timetypeseconds, unsignednanoseconds) Fast constructor. This directly fills the internal structures. It is therefore faster than the other constructors, in particular the default constructor, which makes a kernel call. Member Function Documentation static absolute_time shevek::absolute_time::create_from_local (unsignedyears, unsignedmonths, unsigneddays, unsignedhours, unsignedminutes, unsignedseconds, unsignednanoseconds = 0) [static] Semi-constructor which creates a new absolute_time given a date in local time. The input is the same as for the similar constructor. bool shevek::absolute_time::operator!= (absolute_timethat) const Compare two moments. Note that this is rarely a useful operation, because minor errors may be introduced by computations. In other words: only use this on times which have been set, never on times which have been computed. bool shevek::absolute_time::operator== (absolute_timethat) const Compare two moments. Note that this is rarely a useful operation, because minor errors may be introduced by computations. In other words: only use this on times which have been set, never on times which have been computed. Author Generated automatically by Doxygen for libshevek from the source code. libshevek Fri May 11 2012 shevek::absolute_time(3)