I want to write a sh script that will find files older than 2 hours and tar them. I've had a look at the find man page but can't see how to do it by hours.
Help please.
Thanx (1 Reply)
I need to write a program that will only remove those files that are older than 2 hours.
Is there some variation of
find . -mtime ? -name '*'
that I can use?
Thanks as always for your help.
Regards,
Dave :) (2 Replies)
What is the command to remove files that are generated 6 hours or older? The find and remove tells only how to remove if the file is one day old or more. Appreciate quick reply. Thanks (3 Replies)
Every day a new .zip file is uploaded to a folder and at mid-night the zip file is to be extracted into a /data/ folder, inside a date-named folder.
# This should extract the contents of a zip file into the /data/ folder into a date based folder
/usr/bin/unzip -a -o... (15 Replies)
I need a script to find files older than 8 hours...
I know i can use mmin but the same is not working...the same only support mtime...
This is the script i created..but the same is only giving 1 hour old..as I have given dt_H as 1 only...but if i give 8..it can go in -(negative)..how to get the... (5 Replies)
Hi all
I have directory /tmp and i have logs are written in it every 18 to 20 hours in date format.
now i need write some if condition which can find which files came into /tmp dir with name start from LOG_`date`.log in last 24 hours.
can somebody help me on this. (2 Replies)
Hi All,
I am using the below script to find all the files in a folder which are older than 6 hours and delete all those files, but some how I am not getting the required output.
find $HOME/Log -type f -name "*.log" -amin +360 -exec rm *.* {} \
can any one please check and let me know... (13 Replies)
How to Deleting Files Older than 1 hours.
Base on SunOS.
this file gen every 1 min.
-rw-r--r-- 1 nobody nobody 4960 Jan 27 02:02 23_201301270201.log
-rw-r--r-- 1 nobody amudu 2325 Jan 27 02:03 33_201301270202.log
-rw-r--r-- 1 nobody amudu 3255 Jan 27 02:03... (2 Replies)
Discussion started by: ooilinlove
2 Replies
LEARN ABOUT ULTRIX
uuclean
uuclean(8c)uuclean(8c)Name
uuclean - uucp spool directory clean-up
Syntax
uuclean -p[pre] [ options ... ]
Description
The command scans the spool directory for files with the specified prefix and deletes all those which are older than the specified number
of hours.
The -ppre argument causes the command to scan for files with pre as the file prefix. You can specify up to 10 arguments. A without any
pre following causes all files older than the specified time to be deleted. You must specify at least one argument.
Options-ntime Delete all files whose age is more than time, in hours, (default is 72 hours) and that have the specified pre as their file
prefix.
-m Send mail to the owner of the file when it is deleted.
-ssystem Delete files in all directories that are subdirectories of the per system spool directory that exists for system. If ALL is
specified, then all system directories are processed. ALL is the default.
-ddirectory Delete files that reside in the named directory. The default directory is The option over rides the option.
The command typically starts the program. In earlier versions, a deleted work file (C.file) would result in mail to the owner of the work
file, regardless of the option. Now, notification of deleted work files is sent to the user ID "uucp". If the option is used, mail is
also sent to the owner.
Examples
Here are some example command lines:
# uuclean -pLTMP. -pLOG. -n4 -d/usr/spool/uucp
# uuclean -d/usr/spool/uucp/.XQTDIR -p -n
# uuclean -smarkie -p -n84
The third example deletes all files for the system that are older than 84 hours.
Files
Directory with commands used by uuclean internally
See Alsouucp(1c), uux(1c), cron(8)uuclean(8c)