05-08-2008
Quote:
Originally Posted by
sourabhsharma
Hello Friends,
In my project I have to schedule a script to be run on every second saturday (once in month). Can you please suggest what entry should I make in cron ?
Hey,
It depends that on which date "Second Saturday" comes in a particular month.
Make a cron job entry with following parameters :
00 23 ? * 6
This is at 00 minutes of hour 23 on Saturday Every Month execute the script. But ? denotes "Which Day of the Month" : this varies and as I said earlier "It depends that on which date 'Second Saturday' comes in a particular month."
Either you program it OR Fix the day of the month as 14th day of the month.
Then cron entry will be :
00 23 14 * 6
Hope you got what I am trying to convey.
Thanks.
Varun
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need to develop a script to check for the day. If the day is a Saturday then the script should check if the Saturday is the last Saturday of the month so that certain set of instruction can be executed is it is the last Saturday. I do not want to use the crontab as this needs to be part... (9 Replies)
Discussion started by: jobbyjoseph
9 Replies
2. UNIX for Advanced & Expert Users
Is there a utility that can be used in a shell script that would run a .sql file for 30 or 31 days in a month at the same time parallely. Please Advice.
Thanks
SD12. (2 Replies)
Discussion started by: sd12
2 Replies
3. Shell Programming and Scripting
Hello Experts,
I have a script which i want to run the on last day of every month.
let say I have backup.sh script which i want to run it every month last day.
Can anyone please help :confused:
thanks (4 Replies)
Discussion started by: aks_1902
4 Replies
4. Shell Programming and Scripting
Hello expert,
I need a logic code {don't want to schedule into crontab} which can run some of my code on 31st of Jan, March, Mya, Aug, Oct, Dec.....
Ex:
if then
echo "success"
fi
Please help me in achieving this
Thanks (3 Replies)
Discussion started by: aks_1902
3 Replies
5. Shell Programming and Scripting
Hi,
Can anyone help in editing CRON (OR) write a script to run another script every second saturday??
I tried to make use of DATE command to find the day but couldnt proceed further.
your help is highly appreciated!
Thanks,
Mahi (11 Replies)
Discussion started by: mahi_mayu069
11 Replies
6. Shell Programming and Scripting
Hi ,
i need to reboot a server during 2nd and 4th saturday every month. i have come up with the below cron
30 17 8-14 * * if ; then /rebootscript; fi # to reboot every second saturday
30 17 22-28 * * if ; then /rebootscript; fi # to reboot every fourth saturday
I am wondering why it... (3 Replies)
Discussion started by: chidori
3 Replies
7. Shell Programming and Scripting
Hi !
I need ur help on a UNIX scheduling Concept understanding :
If I need to schedule a job (Say ETL Datastage job) through a shell script using the Cron function to make it run on every second saturday of every month, How can I do it ?
:confused: (2 Replies)
Discussion started by: Ravichander
2 Replies
8. Shell Programming and Scripting
Hi All,
Requirement :-
I have shell script in kern shell ,have to run alternate week per month
example-today's date is 27 Mar 2013 and my script will run today then for the next time when it will run it should check 1st what was the last run date(27 Mar 2013) if it is matched 15days from... (2 Replies)
Discussion started by: krupasindhu18
2 Replies
9. Shell Programming and Scripting
I am looking for a unix script which could run a job on 2, 4 and 7 working day of the month.
if the days are falling on the saturday/sunday. it should run on the next day.
Thank you.. (9 Replies)
Discussion started by: tradingspecial
9 Replies
10. Shell Programming and Scripting
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
LEARN ABOUT NETBSD
nl_langinfo
NL_LANGINFO(3) BSD Library Functions Manual NL_LANGINFO(3)
NAME
nl_langinfo -- get locale information
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <langinfo.h>
char *
nl_langinfo(nl_item item);
DESCRIPTION
The nl_langinfo() function returns a pointer to a string containing information set by the program's locale.
The names and values of item are defined in <langinfo.h>. The entries under Category indicate in which setlocale(3) category each item is
defined.
Constant Category Meaning
CODESET LC_CTYPE Codeset name
D_T_FMT LC_TIME String for formatting date and time
D_FMT LC_TIME Date format string
T_FMT LC_TIME Time format string
T_FMT_AMPM LC_TIME A.M. or P.M. time format string
AM_STR LC_TIME Ante-meridiem affix
PM_STR LC_TIME Post-meridiem affix
DAY_1 LC_TIME Name of the first day of the week (e.g.: Sunday)
DAY_2 LC_TIME Name of the second day of the week (e.g.: Monday)
DAY_3 LC_TIME Name of the third day of the week (e.g.: Tuesday)
DAY_4 LC_TIME Name of the fourth day of the week (e.g.: Wednesday)
DAY_5 LC_TIME Name of the fifth day of the week (e.g.: Thursday)
DAY_6 LC_TIME Name of the sixth day of the week (e.g.: Friday)
DAY_7 LC_TIME Name of the seventh day of the week (e.g.: Saturday)
ABDAY_1 LC_TIME Abbreviated name of the first day of the week
ABDAY_2 LC_TIME Abbreviated name of the second day of the week
ABDAY_3 LC_TIME Abbreviated name of the third day of the week
ABDAY_4 LC_TIME Abbreviated name of the fourth day of the week
ABDAY_5 LC_TIME Abbreviated name of the fifth day of the week
ABDAY_6 LC_TIME Abbreviated name of the sixth day of the week
ABDAY_7 LC_TIME Abbreviated name of the seventh day of the week
MON_1 LC_TIME Name of the first month of the year
MON_2 LC_TIME Name of the second month
MON_3 LC_TIME Name of the third month
MON_4 LC_TIME Name of the fourth month
MON_5 LC_TIME Name of the fifth month
MON_6 LC_TIME Name of the sixth month
MON_7 LC_TIME Name of the seventh month
MON_8 LC_TIME Name of the eighth month
MON_9 LC_TIME Name of the ninth month
MON_10 LC_TIME Name of the tenth month
MON_11 LC_TIME Name of the eleventh month
MON_12 LC_TIME Name of the twelfth month
ABMON_1 LC_TIME Abbreviated name of the first month
ABMON_2 LC_TIME Abbreviated name of the second month
ABMON_3 LC_TIME Abbreviated name of the third month
ABMON_4 LC_TIME Abbreviated name of the fourth month
ABMON_5 LC_TIME Abbreviated name of the fifth month
ABMON_6 LC_TIME Abbreviated name of the sixth month
ABMON_7 LC_TIME Abbreviated name of the seventh month
ABMON_8 LC_TIME Abbreviated name of the eighth month
ABMON_9 LC_TIME Abbreviated name of the ninth month
ABMON_10 LC_TIME Abbreviated name of the tenth month
ABMON_11 LC_TIME Abbreviated name of the eleventh month
ABMON_12 LC_TIME Abbreviated name of the twelfth month
ERA LC_TIME Era description segments
ERA_D_FMT LC_TIME Era date format string
ERA_D_T_FMT LC_TIME Era date and time format string
ERA_T_FMT LC_TIME Era time format string
ALT_DIGITS LC_TIME Alternative symbols for digits
RADIXCHAR LC_NUMERIC Radix character
THOUSEP LC_NUMERIC Separator for thousands
YESEXPR LC_MESSAGES Affirmative response expression
NOEXPR LC_MESSAGES Negative response expression
RETURN VALUES
nl_langinfo() returns a pointer to an empty string if item is invalid.
EXAMPLES
The following example uses nl_langinfo() to obtain the date and time format for the current locale:
#include <time.h>
#include <langinfo.h>
#include <locale.h>
int main(void)
{
char datestring[100];
struct tm *tm;
time_t t;
char *ptr;
t = time(NULL);
tm = localtime(&t);
(void)setlocale(LC_ALL, "");
ptr = nl_langinfo(D_T_FMT);
strftime(datestring, sizeof(datestring), ptr, tm);
printf("%s
", datestring);
return (0);
}
SEE ALSO
setlocale(3), tm(3), nls(7)
STANDARDS
The nl_langinfo() function conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
HISTORY
The nl_langinfo() function appeared in NetBSD 1.0.
BSD
April 14, 2011 BSD