Sponsored Content
Top Forums Shell Programming and Scripting Run shell script alternate week per month Post 302784401 by sam05121988 on Friday 22nd of March 2013 06:19:49 AM
Old 03-22-2013
RedHat use epoch arithmetic

you can perform epoch arithmetic

Code:
1 day = 86400 secs
15 days = 1296000 secs


today's date
Code:
$ date
Fri Mar 22 06:18:17 EDT 2013

script to calculate date after 15 days

Code:
today=`date +%s`;let after_15=today+1296000; date -d "@${after_15}"

o/p
Code:
Sat Apr  6 06:16:39 EDT 2013

This User Gave Thanks to sam05121988 For This Post:
 

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
platform::shell(n)					       Tcl Bundled Packages						platform::shell(n)

__________________________________________________________________________________________________________________________________________________

NAME
platform::shell - System identification support code and utilities SYNOPSIS
package require platform::shell ?1.1.4? platform::shell::generic shell platform::shell::identify shell platform::shell::platform shell _________________________________________________________________ DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell. This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only requirement is that the other shell (identified by its path), is actually executable on the current machine. While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run 32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers. For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed packages, versus the architecture of the shell running the repository software. COMMANDS
platform::shell::identify shell This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell. platform::shell::generic shell This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell. platform::shell::platform shell This command returns the contents of tcl_platform(platform) for the specified Tcl shell. KEYWORDS
operating system, cpu architecture, platform, architecture platform::shell 1.1.4 platform::shell(n)
All times are GMT -4. The time now is 02:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy