check the current date file in directory


 
Thread Tools Search this Thread
Operating Systems Solaris check the current date file in directory
# 1  
Old 12-21-2007
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 date and yesterday date and remaining day i have recieved only one file in this directory which is for current date.

3) everytime filename is same but only timesatmp is different.

I shall be very thankful to all of us , if anyone can sortout this problem.
# 2  
Old 12-21-2007
Please post your script. It will make it easier to understand your problem.

Cheers...Cassj
# 3  
Old 01-04-2008
files modified within 1 day

> find -mtime -1

This will show files modified within the past day in the current directory. There is also a -ctime and -atime parameters available.

Normally users think of this in the opposite logic of finding files not modified in 10 days (for archive, etc...), and that would be
> find -mtime +10
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Searching for a files based on current date directory

Hi All, I've been trying to do some recursive searching but not been very successful. Can someone please help. Scenario: I have directory structure /dir1/dir2/dir3/ 2019/ 11/ 17 18 19 20 so what I want to do is run a script and as its 2019/11/18/ today it would go and only search... (3 Replies)
Discussion started by: israr75
3 Replies

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

3. Shell Programming and Scripting

I need to back up a bunch of files on a directory and save that file as the current date....

this is what i have to find the files modified within the past 24 hours find . -mtime -1 -type f -print0 | xargs -0 tar rvf "$archive.tar" however i need to save/name this archive as the current date (MM-DD,YYYY.tar.gz) how do i doo this (1 Reply)
Discussion started by: bugenhagen_
1 Replies

4. UNIX for Dummies Questions & Answers

Delete a row from a file if one column containing a date is greater than the current system date

Hello gurus, I am hoping someone can help me with the required code/script to make this work. I have the following file with records starting at line 4: NETW~US60~000000000013220694~002~~IT~USD~2.24~20110201~99991231~01~01~20101104~... (4 Replies)
Discussion started by: chumsky
4 Replies

5. Shell Programming and Scripting

Create a directory named as the current date

I am preparing a shell script to backup a few config files on a daily basis, with a retention of 30 days. Need some help with syntax/examples: The shell script (running as cron) would require the following: 1. create a sub-directory within a specified (backup) directory, in the format... (3 Replies)
Discussion started by: FeNiCrC_Neil
3 Replies

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

7. UNIX for Dummies Questions & Answers

Create a directory using current date

Hi, I have a question, is there any way I can, when i create a directory, put the current date on it so that the directory name will be "name-current date"? just curious (3 Replies)
Discussion started by: aric87
3 Replies

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

9. Shell Programming and Scripting

how to check whether the given file is 5 weeks older than current date

HI, I need to check whether the given file is 5 weeks older than current date ?? Can anyone give me the script for this ?? (1 Reply)
Discussion started by: risshanth
1 Replies

10. UNIX for Dummies Questions & Answers

create directory named current date

Since this site solved my problems before, I am back for more (solutions) I down load via a script every day a file that has the same name as the file of the day before. I want to move that file to its own directory like: /archive/jul30 How do I capture the systems date in a script an... (2 Replies)
Discussion started by: flowrats
2 Replies
Login or Register to Ask a Question