Sponsored Content
Top Forums Shell Programming and Scripting Run shell script alternate week per month Post 302785617 by krupasindhu18 on Tuesday 26th of March 2013 04:32:42 AM
Old 03-26-2013
Hi,

I am getting below errors

Code:
`date +%s`;let after_15=today+1296000; date -d "@${after_15}"
date: bad format character - s
ksh: after_15=today+1296000: bad number
date: illegal option -- d
Usage: date [-u] [+format]
       date [-u] [mmddhhmm[[cc]yy]]
       date [-a [-]sss.fff]

this is Working in Bash shell but not in ksh
Please provide me alternate solutions

Thanks,
Krupa

Last edited by Franklin52; 03-26-2013 at 06:40 AM.. Reason: Please use code tags for data and code samples
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Getting week in month.???

Hi All, I have a tricky problem. I need to write a shell script (bash) which identifies which week off the month it is. I need to create a partition each week. So for the first week (where first of the week is Monday) of March i want to create partition_march_01 and for the second partition... (1 Reply)
Discussion started by: Zak
1 Replies

2. Shell Programming and Scripting

Execute a script on 4 week of the month

I need help to write a script and it will execute on Saturday of the last week of every month. For example : 09/30/2006 is the last Saturday on Sept. 2006 08/26/2006 is the last Saturday on Aug. 2006 07/29/2006 is the last Saturday on July. 2006 etc.. ... (1 Reply)
Discussion started by: tbdo88
1 Replies

3. UNIX for Advanced & Expert Users

Run a script parallel for a month's worth:

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

4. UNIX for Advanced & Expert Users

How to scedule a script to be run on every second saturday in Month?

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 ? (5 Replies)
Discussion started by: sourabhsharma
5 Replies

5. Shell Programming and Scripting

run the script for last day of the month

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

6. Shell Programming and Scripting

run the script on every 31st of month.....

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

7. Answers to Frequently Asked Questions

Finding the nth Particular Week in a Month – shell script

I see lot of request posted in internet to find out the day of nth week in a Month. example: what is the date of 3rd Sunday in October What is the date of 2nd Friday in June 2012 what is the date of 4th Saturday in January 2011..etc.. The below shell script is used to find out the... (1 Reply)
Discussion started by: itkamaraj
1 Replies

8. Shell Programming and Scripting

Alternate mondays to run the script

I need to run a script every other monday (alternate mondays) , Can anyone has logic to put into timer script. We are using below logic to run scripts every day daywk_is=$(date "+%u") if ] then 1=monday, 2=tuesday, 3=wed, 4=thr, 5=fri, 6=sat, 7=sun can anyone have idea on this (14 Replies)
Discussion started by: nani1984
14 Replies

9. Shell Programming and Scripting

Script to run on 2 4 and 7 day of the month

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

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
NetSDS::Util::DateTime(3pm)				User Contributed Perl Documentation			       NetSDS::Util::DateTime(3pm)

NAME
NetSDS::Util::DateTime - common date/time processing routines SYNOPSIS
use NetSDS::Util::DateTime; print "Current date: " . date_now(); DESCRIPTION
This package provides set of routines for date and time processing. EXPORTED FUNCTIONS
date_now_array([TIME]) Returns array of date items for given date. If source date is not set current date used. date_now([TIME]) Return [given] date as string. 2001-12-23 14:39:53 date_now_iso8601([TIME]) Return date as ISO 8601 string. 20011223T14:39:53Z <http://en.wikipedia.org/wiki/ISO_8601> http://www.w3.org/TR/NOTE-datetime <http://www.w3.org/TR/NOTE-datetime> date_strip(DATE) Trim miliseconds from date. date_date(DATE) Trim time part from date. date_time(DATE) Trim date part from date. time_from_string($string) Return parsed date/time structure. date_from_string($string) Return date from string representation. date_inc([INCREMENT, [TIME]]) Return date incremented with given number of seconds. date_inc_string([INCREMENT, [TIME]]) Return string representation of date incremented with given number of seconds. EXAMPLES
None yet BUGS
Unknown yet SEE ALSO
Date::Parse, Date::Format TODO
Import stuff from Wono project AUTHOR
Valentyn Solomko <val@pere.org.ua> Michael Bochkaryov <misha@rattler.kiev.ua> perl v5.12.4 2011-08-27 NetSDS::Util::DateTime(3pm)
All times are GMT -4. The time now is 08:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy