Sponsored Content
Top Forums Shell Programming and Scripting how to check whether the given file is 5 weeks older than current date Post 302142670 by matrixmadhan on Monday 29th of October 2007 04:53:22 AM
Old 10-29-2007
Please search in the forum Smilie

There are many other threads discussing the same.

man find - atime / mtime
 

10 More Discussions You Might Find Interesting

1. Solaris

check the current date file in directory

Hi, I am making a script which check the directory and if there is today date file, it is showing message file is there for today date . 1) filename is accessline.win.$timestamp example ;-accessline.win.200712211004 2) On monday i have recieved two file in this directory with current... (2 Replies)
Discussion started by: pallvi
2 Replies

2. Shell Programming and Scripting

Finding files older than the current date and time and renaming and moving

Hi, I have a very urgent requirement here. I have to find all files in the specified directory but not in the sub directories(The directory name is stored in a variable) which are older than the current date as well as current time and rename it as filename_yyyymmddhhmmss.ext and move it into a... (7 Replies)
Discussion started by: ragavhere
7 Replies

3. Shell Programming and Scripting

How to check date variable according to the current date?

Hi folks, I need to write a script that should activate a process according to the current hour. The process should be activatet only if the hour is between midnight (00:00) and 07:00. How should I create the condition? Thanks in advance, Nir (2 Replies)
Discussion started by: nir_s
2 Replies

4. Shell Programming and Scripting

Delete the files older than 3 weeks in a particular directory.

Hi, Friends, I am writing a script to delete all the files which are there for more than 3 weeks. I have tried this : find /home/appl/backup -type f -mtime +21 -exec rm -f {} \; But i am not sure if it deletes only the files in specified directory or all the directorinies in the provieded... (3 Replies)
Discussion started by: rajsharma
3 Replies

5. Shell Programming and Scripting

Shell Script to compare files, check current date and count

Hello - I have written the following basic shell script to count files, compare files and look for a particular strings in a file. Problem 1: How do I define more than 1 file location? #!/bin/bash #this is a test script FILES=$(ls /home/student/bin/dir1, home/student/bin/dir2)... (0 Replies)
Discussion started by: DallasT
0 Replies

6. Shell Programming and Scripting

[SOLVED] Pull lines older than N weeks

There is another post in the forums that is similar to what I am trying to do, however, the thread is closed. So, I am creating this new one to see if someone could help. I am trying to use the code Ahamed posted, and tweak it. With the info from the forum, I recreated the scenario the person... (8 Replies)
Discussion started by: karstenjhilton
8 Replies

7. Shell Programming and Scripting

Move log files with date and delete older than 3 weeks

I have written a script which generate one logfile on every sunday and thursday I want to move the older log files into /tmp directory befor generating new one so i used mv command like mv usr/sbin/appl/logfile.txt usr/sbin/appl/tmp 2) But when i move this file to /tmp it will... (1 Reply)
Discussion started by: Nakul_sh
1 Replies

8. Shell Programming and Scripting

List 2 weeks older file on specific directory

Ive been a vocal of FIND command even before. Command below doesnt really give me the file that is older than two weeks.. Is there a script that will list me the log files that i want like for this date December 10, 2014, it shud list me the date between November 26, 2014 and below. When i run... (6 Replies)
Discussion started by: kenshinhimura
6 Replies

9. UNIX for Beginners Questions & Answers

Subscribers with Date 90 days older than current date

I have to display only those subscribers which are in "unconnected state" and the date is 90 days older than today's date. Below command is used for this purpose: cat vfsubscriber_20170817.csv | sed -e 's/^"//' -e '1d' | nawk -F '",' '{if ( (substr($11,2,4) == 2017) && ( substr($11,2,8) -lt... (1 Reply)
Discussion started by: dia
1 Replies

10. Shell Programming and Scripting

Shell script to check current date file is created and with >0 kb or not for multiple directories

Hi All, I am new in scripting and working in a project where we have RSyslog servers over CentOS v7 and more than 200 network devices are sending logs to each RSyslog servers. For each network devices individual folders create on the name of the each network devices IP addresses.The main... (7 Replies)
Discussion started by: Pinaki
7 Replies
birthday(1)						      General Commands Manual						       birthday(1)

NAME
birthday - warn about upcoming birthdays and other events SYNOPSIS
birthday [-w|-c] [-f file] [-W defwarn] [-M maxwarn] [-m minwarn] [-l lines] [-p weeks] [-d total] [-i width] DESCRIPTION
The birthday command reads a file, by default ~/.birthdays, which gives a list of events in the near future (see section FILE FORMAT for details). It can then produce either a list of events which are coming up within the next few weeks, or a text-based calendar with a few lines for each day. OPTIONS
-w Display a list of upcoming events. This is the default. -c Display a calendar, designed to be piped to lpr(1). -f file Read the events from file rather than ~/.birthdays. If file is a single hyphen, read the events from the standard input (usually the terminal). List Options -W warn Warn warn days in advance, for entries that have no w flag (see FILE FORMAT). If this switch is not specified, it defaults to 21 days. -M max Warn at most max days in advance. This overrides any flag given in the file. -m min Warn at least min days in advance. This overrides any flag given in the file. Calendar Options -l lines Print lines lines for every day. -p weeks Print weeks weeks on every page of the calendar. If set to 0, the default, disables page breaks. -d days Print the calendar for up to days days in advance. -i width Print the calendar width characters wide. This affects the length of the lines separating each day, and the point at which events will be word-wrapped. FILE FORMAT
Each line beginning with a hash sign, `#', is a comment and will be ignored. Lines beginning with an ampersand, `&', are directives. Cur- rently there is only one such directive, &include file, which reads in a seperate file from your .birthdays file. file should be given with an absolute path, which should not use the tilde notation to specify your home directory. Any other line specifies the name of a person or event, followed by an equals sign and a date (DD/MM, DD/MM/YY or DD/MM/YYYY, where the form DD/MM/YY is assumed to give a date in the 20th century and is now deprecated), and finally some extra options. These options are: bd This line is a birthday (the default). The year, if given, should be when the person was born. A line designated as a birthday will produce output like Erin has a birthday in 3 days' time or Jemima is 3 in 2 weeks' time. ann This line is an anniversary. The year, if given, should be the year in which the thing happened, producing output like Pen exploded 3 years ago tomorrow given a line such as Pen exploded=12/09/93 ann. ev This line is an event of some sort. If a year is given, the text will be displayed in that year only; otherwise, it will be dis- played every year. The remaining time is simply appended to the text; for instance, the input Easter=7/4/1996 ev would give rise to the text Easter in 1 week's time. wn Warn n days in advance of the date, rather than the default of 21 days or the number given with the -W flag. todate The event lasts until date, which should be in the same format as for the date of the event. fordays The event lasts for days days. DATE SPECIFICATION
The file format documented here handles dates in a couple of slightly non-standard ways. Firstly, the dates are given in British format of DD/MM/YYYY, as opposed to the more normal US format MM/DD/YYYY. Secondly, dates with a two-digit year are assumed to be in the 20th century (19xx), rather than taking the standard convention of assuming all two-digit years less than 70 are in the 21st century. This is for reasons of compatibility with older data files, since many people have birthdays before 1970, and the program was written before I came across the Y2K issues. :-( You should probably avoid this format. EXAMPLE
Joe Blow=25/04/1974 FILES
~/.birthdays Your default birthdays file. SEE ALSO
cal(1) BUGS
Both the "features" in the DATE SPECIFICATION section could be construed as bugs, and are mostly present for backwards compatibility. The calendar mode should be a seperate program. The program cannot warn more than one year in advance of anything. AUTHOR
Andy Mortimer <andy.mortimer@zetnet.co.uk> birthday(1)
All times are GMT -4. The time now is 05:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy