Was to turn the date math trick shown above into a script that I named 'last-day-of-month.sh':
Which can then be used within a crontab file as follows:
I hope this is of some use to you...
Hi,
I would like to find out how can i calculate a date which is 3 months ago. I intend to run a cron job on the 1st of every month, and calculate the month 4 months earlier from the date. For example, if today's date is 1st May 2007, i would like to return 012007( January 2007).
i can get... (1 Reply)
I know I can't schedule this in cron and would have to write a wrapper around my script and schedule it in cron ....but not sure how do to this?
How do I exclude Monday if the 2nd day of the month falls on a Monday?
Thanks.
I tried this:
0 0 2 * 0,2-6 command
And I know this doesnt... (2 Replies)
Hello Friends,
I have a cron tab like this:
10,40 1-23 * * * /script
i want to skip only one execution at 00:10, so basically i want it to execute every hour at 10th and 40th minute, except 00:10.
Could anyone help me doing this
Thanks folks
:b: (4 Replies)
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)
Hello Guys,
I have a questions regarding running a shell script every second working day each month.
I have no clue how solve this problem :wall:.
Important is that it has to be the second working (Mo-Fr).
Example: If 1st and 2nd Days of month are Sat and Sun the script must run on 4th day... (5 Replies)
Hi all,
I currently have a UNIX file maintenance script that runs daily as a cron job.
Now I want to change the script and create functions/sub inside it that runs on a weekly or monthly basis.
To run all the scripts' daily maintenance, I want to schedule it in cron as simply maint.sh... (1 Reply)
The following bash command line works for the last day of the month. Test by replacing the 1 with tomorrows day of month number
&& echo "Day before tomorrow"Can it be used within crontab? As
* * 28-31 * * && echo "Today ls last day of month" >>/tmp/crontabtestI tried to test crontab with... (1 Reply)
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)
I have query apply crontab entry that the script executes as below
day hours (before 8:00 PM and after 7:00 AM) execute every 5 min
in Night hours (after 8:00 PM to 7:00 AM) executes every 15 min
How can we set such entry in crontab ? (4 Replies)
Discussion started by: kaushik02018
4 Replies
LEARN ABOUT HPUX
calendar
calendar(1) General Commands Manual calendar(1)NAME
calendar - reminder service
SYNOPSIS DESCRIPTION
consults the file in the current directory and prints out lines containing today's or tomorrow's date anywhere in the line. On weekends,
``tomorrow'' extends through Monday.
When a command-line argument is present, searches for the file in each user's home directory, and sends any positive results to the user by
(see mail(1)). Normally this is done daily in the early morning hours under the control of (see cron(1M)). When invoked by reads the
first line in the file to determine the user's environment.
Language-dependent information such as spelling and date format (described below) are determined by the user-specified statement in the
file. This statement should be of the form where language is a valid language name (see lang(5)). If this line is not in the file, the
action described in the section is taken.
is concerned with two fields: month and day. A month field can be expressed in three different formats: a string representing the name of
the month (either fully spelled out or abbreviated), a numeric month, or an asterisk (representing any month). If the month is expressed
as a string representing the name of the month, the first character can be either upper-case or lower-case; other characters must be lower-
case. The spelling of a month name should match the string returned by calling (see nl_langinfo(3C)). The day field is a numeric value
for the day of the month.
Month-Day Formats
If the month field is a string, it can be followed by zero or more blanks. If the month field is numeric, it must be followed by either a
slash or a hyphen If the month field is an asterisk it must be followed by a slash The day field can be followed immediately by a blank or
non-digit character.
Day-Month Formats
The day field is expressed as a numeral. What follows the day field is determined by the format of the month. If the month field is a
string, the day field must be followed by zero or one dot followed by zero or more blanks. If the month field is a numeral, the day field
must be followed by either a slash or a hyphen If the month field is an asterisk, the day field must be followed by a slash
EXTERNAL INFLUENCES
Environment Variables
determines the format and contents of date and time strings when no statement is specified in the file.
determines the language in which messages are displayed.
If is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty vari-
able. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization
variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
EXAMPLES
The following file illustrates several formats recognized by calendar:
In the following file, dates are expressed according to European English usage:
WARNINGS
To get reminder service, either your calendar must be public information or you must run from your personal file, independent of any run
systemwide. Note that if you run yourself, the calendar file need not reside in your home directory.
extended idea of ``tomorrow'' does not account for holidays.
This command is likely to be withdrawn from X/Open standards. Applications using this command might not be portable to other vendors'
platforms.
AUTHOR
was developed by AT&T and HP.
FILES
to figure out today's and tomorrow's dates
SEE ALSO
cron(1M), nl_langinfo(3C), mail(1), environ(5).
STANDARDS CONFORMANCE calendar(1)