Hi all,
how to write a script that will indentify the files in a directory which are 7 days old and delete those files.
Thanks in advance
Cheers
Arunava (8 Replies)
I have a directory that contains files. I would like the command that deletes all files that are over 30 days old. Delete files based on creation date and not modified. (2 Replies)
I want to delete any file in unix file system which is older then a week.
Those files should not be unix system file..means it should be user created file.
Any clue to this ??
ASAP.
Thanks. (2 Replies)
Hi, All,
I'd like to delete files older than 1 day.
I thought the following command
find /your_directory -mtime +1-exec rm -f {} \;
will do the work, but not so, it seems like it won't delete files unless it is 2 days old or older. the files between 1 day and 2 days old does not... (7 Replies)
Dear all,
I have a directory /homes/zak in which I have a number of directories which are created on a daily basis
thus:
02-MAY-10
03-MAY-10
04-MAY-10
05-MAY-10
I want to script the clean up of these directories, so I only keep two days worth,
so for example anything over 2 days... (10 Replies)
I am using SFTP to transmit files from the Mainframe to an UNIX server. I am looking for some kind of script that runs with SFTP to delete tranmitted files older than 3 days.
Can this be done in a SFTP transmission batch job? (5 Replies)
Hi Team,
I have to remove files which are more than 7 days in my target directory.
I have this script but using this i faced some problems like, removed library files of unix.
for abc in `find /xxx/abc/OutputFiles/xxxx_*.txt -type f -mtime +5|xargs ls 1`
do
echo "xxx files are:"$abc
... (1 Reply)
I need to list and delete all files in current older which are olderthan 7 days. But my file names have white spaces. Before deleting I want to list all the files, so that I can verify.find . -type f -mtime +7 | xargs ls -l {}
But the ls command is the working on the files which have white... (16 Replies)
I want to search 2 day older file and then delete last 10 line of that file. (2 Replies)
Discussion started by: sonu pandey
2 Replies
LEARN ABOUT OPENDARWIN
gendiff
GENDIFF(1) General Commands Manual GENDIFF(1)NAME
gendiff - utility to aid in error-free diff file generation
SYNOPSIS
gendiff <directory> <diff-extension>
DESCRIPTION
gendiff is a rather simple script which aids in generating a diff file from a single directory. It takes a directory name and a "diff-
extension" as its only arguments. The diff extension should be a unique sequence of characters added to the end of all original, unmodi-
fied files. The output of the program is a diff file which may be applied with the patch program to recreate the changes.
The usual sequence of events for creating a diff is to create two identical directories, make changes in one directory, and then use the
diff utility to create a list of differences between the two. Using gendiff eliminates the need for the extra, original and unmodified
directory copy. Instead, only the individual files that are modified need to be saved.
Before editing a file, copy the file, appending the extension you have chosen to the filename. I.e. if you were going to edit somefile.cpp
and have chosen the extension "fix", copy it to somefile.cpp.fix before editing it. Then edit the first copy (somefile.cpp).
After editing all the files you need to edit in this fashion, enter the directory one level above where your source code resides, and then
type
$ gendiff somedirectory .fix > mydiff-fix.patch
You should redirect the output to a file (as illustrated) unless you want to see the results on stdout.
SEE ALSO diff(1), patch(1)AUTHOR
Marc Ewing <marc@redhat.com>
4th Berkeley Distribution Mon Jan 10 2000 GENDIFF(1)