Sponsored Content
Top Forums Shell Programming and Scripting How to tar, compress and remove files older than two days Post 302309505 by edr on Wednesday 22nd of April 2009 04:55:38 AM
Old 04-22-2009
Question

Hi.

Thanks a lot for helping me.
There is one thing I do not understand.
I 've four wav files with a different date.

-rw-r----- 1 dtuser staff 258904 Apr 22 09:53 3210223758_73072441618_20090415151440972.wav
-rw-r----- 1 dtuser staff 192504 Apr 21 09:53 3210224056_73073919768_20090418102231949.wav
-rw-r----- 1 dtuser staff 258904 Apr 20 09:53 3210223758_73072441618_20090415151440972.wav
-rw-r----- 1 dtuser staff 192504 Apr 19 09:53 3210224056_73073919768_20090418102231949.wav

Using the recommended commands in my test scrip have no making any sense.

find ${MAIN_DIR} -name *.wav -mtime -3 > FILE_LIST
or
find ${MAIN_DIR} -name \*.wav -mtime -3 -exec mv {} \;

-mtime -3 or -mtime -5 or -mtime -10 makes no difference.
The result is that all files are compressed and removed instaed of the files of three days old.

Best regards.
Eddy.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

tar files older than 30 days

Hi there, I am trying to tar a number of files held in a specific folder. I am only interested in archiving files older than 30 days. Having read through the man entries and all available documentation I thought I'd cracked the coomand with tar -c -z -v -N 15/04/2004 -f /wfch.tar * This... (6 Replies)
Discussion started by: wfch
6 Replies

2. UNIX for Dummies Questions & Answers

Find files older than 5 days and remove tem after listing

need help with this ... Find files older than 5 days and remove tem after listing list "test" file older than 5 days and then remove them (1 Reply)
Discussion started by: ypatel6871
1 Replies

3. Shell Programming and Scripting

Need to remove files older than 30 days except directories

Hi, I need to remove files (*.trc) which are older than 30 days from one location. My problem is there I do not want to visit any of the directories at that location. I want to search files at that particular location only (need to skip directorys at that location). maxdepth option is there... (6 Replies)
Discussion started by: malaymaru
6 Replies

4. Solaris

Find files older than x days and create a consolidated single tar file.

Hello, I need help in finding files older than x days and creating a single consolidated tar file combining them. Can anyone please provide me a script? Thanks, Dawn (3 Replies)
Discussion started by: Dawn Bosch
3 Replies

5. Shell Programming and Scripting

Need script to tar files older than 30 days

Hi all. Here's my situation: I have performance reports that run every 30 minutes saved in the format: stats_report_11251000.txt stats_report_11251030.txt stats_report_11251100.txt stats_report_11251130.txt (Obviously run at Nov 25 10 AM, 10:30 AM, 11 AM and so on...) I would... (2 Replies)
Discussion started by: jamie_collins
2 Replies

6. Shell Programming and Scripting

script to remove files older than 60 days

Hi I need help in the script which looks at a contorl file which has a list of file names like xxxx.12345 and I want to take only xxxxx and search in a specific directory and remove the file if its older than 60 days I have written something like this.. but seems to be wrong... (1 Reply)
Discussion started by: antointoronto
1 Replies

7. Shell Programming and Scripting

Remove files older than 2 days.

Hi All, I am new to the scripting and using solaris 10 OS. Please suggest me from the below script which modifications need to be done to delete the files more that 2days older. Current script is deleting existing file. # Remove old explorer runs if needed DIR=`dirname ${EXP_TARGET}` if ... (2 Replies)
Discussion started by: Navkreddy
2 Replies

8. UNIX for Dummies Questions & Answers

How to compress the directories which is older than 7 days?

Hi all, how to compress the directories which is older 7 days. If any one knows please help me this is urgent. Thanks in advance (3 Replies)
Discussion started by: rameshpagadala
3 Replies

9. Shell Programming and Scripting

How to create zip/gz/tar files for if the files are older than particular days in UNIX or Linux?

I need a script file for backup (zip or tar or gz) of old log files in our unix server (causing the space problem). Could you please help me to create the zip or gz files for each log files in current directory and sub-directories also? I found one command which is to create gz file for the... (4 Replies)
Discussion started by: Mallikgm
4 Replies

10. Shell Programming and Scripting

Compress folders older than x days

hello everyone. in /opt/abc every night there is a new folder created. in that folder there is aseries of files created for that day. i would like to run a script every Sunday night at 02:00 to compress each file separately (preserving its name) who is older than 2 days. i have found this... (2 Replies)
Discussion started by: atux
2 Replies
UUENCODE(1)						    BSD General Commands Manual 					       UUENCODE(1)

NAME
uuencode, uudecode -- encode/decode a binary file SYNOPSIS
uuencode [-m] [-o output_file] [file] name uudecode [-cips] [file ...] uudecode [-i] -o output_file [file] DESCRIPTION
The uuencode and uudecode utilities are used to transmit binary files over transmission mediums that do not support other than simple ASCII data. The uuencode utility reads file (or by default the standard input) and writes an encoded version to the standard output, or output_file if one has been specified. The encoding uses only printing ASCII characters and includes the mode of the file and the operand name for use by uudecode. The uudecode utility transforms uuencoded files (or by default, the standard input) into the original form. The resulting file is named either name or (depending on options passed to uudecode) output_file and will have the mode of the original file except that setuid and exe- cute bits are not retained. The uudecode utility ignores any leading and trailing lines. The following options are available for uuencode: -m Use the Base64 method of encoding, rather than the traditional uuencode algorithm. -o output_file Output to output_file instead of standard output. The following options are available for uuencode: -m Use the Base64 method of encoding, rather than the traditional uuencode algorithm. -o output_file Output to output_file instead of standard output. The following options are available for uudecode: -c Decode more than one uuencode'd file from file if possible. -i Do not overwrite files. -o output_file Output to output_file instead of any pathname contained in the input data. -p Decode file and write output to standard output. -s Do not strip output pathname to base filename. By default uudecode deletes any prefix ending with the last slash '/' for security purpose. EXAMPLES
The following example packages up a source tree, compresses it, uuencodes it and mails it to a user on another system. When uudecode is run on the target system, the file ``src_tree.tar.Z'' will be created which may then be uncompressed and extracted into the original tree. tar cf - src_tree | compress | uuencode src_tree.tar.Z | mail sys1!sys2!user The following example unpack all uuencode'd files from your mailbox into your current working directory. uudecode -c < $MAIL The following example extract a compress'ed tar archive from your mailbox uudecode -o /dev/stdout < $MAIL | zcat | tar xfv - SEE ALSO
basename(1), compress(1), mail(1), uucp(1), uuencode(5) BUGS
Files encoded using the traditional algorithm are expanded by 35% (3 bytes become 4 plus control information). HISTORY
The uudecode and uuencode utilities appeared in 4.0BSD. BSD
January 27, 2002 BSD
All times are GMT -4. The time now is 03:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy