Hi All,
I'm a new member of this Forum. I have need your help to handle this request.
"Compress a file name not of today but of yesterday only".
For example
If I use this Unix/Linux command
only the files of today will be compressed. If I set -2 as mtime I find the files of today and of yesterday compressed.
I need to use compress ONLY the files of yesterday (Here 22 mar).
Any suggestion will be well appreciated.
Thanks in advance for your kind support.
Regards,
Giovanni
Moderator's Comments:
How to use code tags when posting data and code samples.
Last edited by Franklin52; 03-24-2012 at 09:18 AM..
Reason: Please use code tags for data and code samples, thank you
Greetings!!! Welcome to the unix and linux forum!!!!
-1 in mtime says to the find command that, get the files are created with in one day.
+1 in mtime says to the find command that, get the files are created more than one day.
Please use code tags for data samples and codes.
Cheers,
Ranga
Last edited by rangarasan; 03-23-2012 at 10:47 AM..
The find command is a weird one since the switches like -mtime etc. usually will list a range of files (i.e. +1 files older than a day, etc.). One way to get only the files created the previous day, is to use a combination of boolean operators and the -daystart switch (see find man page):
Hi dears,
Hi All,
I'm a new member of this Forum. I have need your help to handle this request.
"I want to copy and Compress files not of today but of yesterday only using some script".
For example
I have the following files under a particular directory in a Solaris machine.
... (7 Replies)
Hi all
I have the following script that should compress a file in a directory:
# compress log files older than 2 days
find /u01/easydone/DBDUMPS/*.dmp -mtime +2 -exec gzip {} \;
BUT the problem is that these files that I want to compress are inside a directory with following format:
... (5 Replies)
Hi All !
We have to compress a big data file in unix server and transfer it to windows and uncompress it using winzip in windows.
I have used the utility ZIP like the below.
zip -e <newfilename> df2_test_extract.dat
but when I compress files greater than 4 gb using zip utility, it... (4 Replies)
I know how to touch like this
touch -t 199908031046 /tmp/file1
But I want to create a cron job for touch a file which 30 min ago in Solaris which haven't -mmin
Can I use like this ? touch -t `date +%s` - 30 /tmp/file1
Because I want to file the file which older than 30min.
Thanks, (6 Replies)
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)
How can I get difference date between today and 15 days ago and all filename is was created before 15 days ago?
It has to be korn shell script.
Thanks. (2 Replies)
How can I get difference date between today and 15 days ago and all filename is was created before 15 days ago?
It has to be korn shell script.
Thanks. (1 Reply)
Hi all:
I am new to this board and UNIX programming so please forgive if I don't explain something correctly.
I am trying to write a script to keep track of our links, we link one program written for Client A to Client B's directory.
What we want to do is to keep track of our linked programs... (1 Reply)