Sponsored Content
Top Forums Shell Programming and Scripting how to get 3rd week of every friday? Post 302690289 by methyl on Wednesday 22nd of August 2012 06:32:12 PM
Old 08-22-2012
Because the date command and cron are critical to this process, please post what Operating System and version you are running and what Shell you use for system scripts.

Also, please provide a short sequence of sample future dates on which this cron should run.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to identify week-1 and week-2

Hello Friends I have three dirs 1. /home/main-bkup 2. /home/bkup-week1 3. /home/bkup-week2 Now we copy backups in 1 initially, then on 1st week we copy few content of 1 into 2 and then run some scripts on that. Then in 2nd week we keep 2 untouched and do the same thing in 3. So I... (1 Reply)
Discussion started by: csaha
1 Replies

2. Shell Programming and Scripting

Need help, Every friday in a month

I am trying to write a script that shows every Friday in a month. I used cal $1 $2 | grep -v "^$" | awk '{print $6}' It doesn't work for the frist week of Friday because calendar command output has some spaces in the first line and awk '{print $6}' doesn't work. Anybody help me with this... (3 Replies)
Discussion started by: LAY
3 Replies

3. Shell Programming and Scripting

Friday afternoon headache

Hi all, It's been a long week and my brain is clearly not functioning right so hopefully someone can help me out here. I've got a function in a script which just checks if a MySQL database directory exists or not. Code is as follows: dbCheck2() { if ; then { : # carry... (4 Replies)
Discussion started by: _Spare_Ribs_
4 Replies

4. Shell Programming and Scripting

how can i find the third friday of each month?

Help please! I need to read the calendar and put the date of the third Friday of each month into a variable for comparison in an "if" statement. How would I do this? Thnx, leslie02 (10 Replies)
Discussion started by: leslie02
10 Replies

5. Shell Programming and Scripting

pickup until last friday files from directory

Freinds, I need help: I need to process number of flat files on weekly basis. My source dir will receive flat files regulary at mid night between 1:00am and 6:00am. When I run my weekly file process it should get only the files which are until last friday (including friday)and move them in... (1 Reply)
Discussion started by: magi
1 Replies

6. Shell Programming and Scripting

Last friday of every month

Hi, I need to get the date of last friday of every month. how can i achieve this ? please guide me. Thanks in advance (3 Replies)
Discussion started by: apsprabhu
3 Replies

7. 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

8. Linux

Bash Display First Friday of the next month

Hello, I need to find the date of next first Friday of the month and set as a variable in a bash script ie - FIRSTFRIDAY=$(date -dfirst-friday +%d) I know date -dfirst-friday doesn't work, but unsure if I can use this / cal + awk or something else to find the right date of the... (7 Replies)
Discussion started by: summerdays
7 Replies
PARSEDATE(3)						   BSD Library Functions Manual 					      PARSEDATE(3)

NAME
parsedate -- date parsing function LIBRARY
System Utilities Library (libutil, -lutil) SYNOPSIS
#include <util.h> time_t parsedate(const char *datestr, const time_t *time, const int *tzoff); DESCRIPTION
The parsedate() function parses a datetime from datestr described in english relative to an optional time point and an optional timezone off- set in seconds specified in tzoff. If either time or tzoff are NULL, then the current time and timezone offset are used. The datestr is a sequence of white-space separated items. The white-space is optional the concatenated items are not ambiguous. An empty datestr is equivalent to midnight today (the beginning of this day). The following words have the indicated numeric meanings: last = -1, this = 0, first, next, or one = 1, second is unused so that it is not confused with ``seconds'', two = 2, third or three = 3, fourth or four = 4, fifth or five = 5, sixth or six = 6, seventh or seven = 7, eighth or eight = 8, ninth or nine = 9, tenth or ten = 10, eleventh or eleven = 11, twelfth or twoelve = 12. The following words are recognized in English only: AM, PM, a.m., p.m. The months: january, february, march, april, may, june, july, august, september, sept, october, november, december, The days of the week: sunday, monday, tuesday, tues, wednesday, wednes, thursday, thur, thurs, friday, saturday. Time units: year, month, fortnight, week, day, hour, minute, min, second, sec, tomorrow, yesterday. Timezone names: gmt, ut, utc, wet, bst, wat, at, ast, adt, est, edt, cst, cdt, mst, mdt, pst, pdt, yst, ydt, hst, hdt, cat, ahst, nt, idlw, cet, met, mewt, mest, swt, sst, fwt, fst, eet, bt, zp4, zp5, zp6, wast, wadt, cct, jst, east, eadt, gst, nzt, nzst, nzdt, idle. A variety of unambiguous dates are recognized: 69-09-10 For years between 69-99 we assume 1900+ and for years between 0-68 we assume 2000+. 2006-11-17 An ISO-8601 date. 10/1/2000 October 10, 2000; the common US format. 20 Jun 1994 23jun2001 1-sep-06 Other common abbreviations. 1/11 the year can be omitted As well as times: 10:01 10:12pm 12:11:01.000012 12:21-0500 Relative items are also supported: -1 month last friday one week ago this thursday next sunday +2 years Seconds since epoch (also known as UNIX time) are also supported: @735275209 Tue Apr 20 03:06:49 UTC 1993 RETURN VALUES
parsedate() returns the number of seconds passed since the Epoch, or -1 if the date could not be parsed properly. SEE ALSO
date(1), eeprom(8) HISTORY
The parser used in parsedate() was originally written by Steven M. Bellovin while at the University of North Carolina at Chapel Hill. It was later tweaked by a couple of people on Usenet. Completely overhauled by Rich $alz and Jim Berets in August, 1990. The parsedate() function first appeared in NetBSD 4.0. BUGS
1 The parsedate() function is not re-entrant or thread-safe. 2 The parsedate() function cannot compute days before the unix epoch (19700101). 3 The parsedate() function assumes years less than 0 mean - year, years less than 70 mean 2000 + year, years less than 100 mean 1900 + year. BSD
December 20, 2010 BSD
All times are GMT -4. The time now is 11:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy