05-21-2011
need a code for moving the log files older than 2 months
Hi Viewer,
I need logic code for moving the logs files from one directory to another directory.
source :/xxxxxx/ xxxxxx / xxxxxx / xxxxxx / log --- under log directory we have so many files from last two years
Here I need to check the files older than two months and I need to move in to below destination path
Destination: / xxxxxx / xxxxxx /2011
So please help me out to make this script
Thanks,
Asker
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
A script or command to list files older than 2 months in a specified directory and remove it. (3 Replies)
Discussion started by: pbekal
3 Replies
2. Solaris
HI
I HAVE LOG FILES IN THIS FORMAT
XXX.log.20080509215745
XXX.log.20080209205745
XXX.log.20080301785745
XXX.log.20080109155745
XXX.log.20080409115745
XXX.log.20080309105745
I NEED TO FIND THE FILES FROM 3 MONTHS OLD AND REMOVE
PLEASE HELP
THANKS, (13 Replies)
Discussion started by: cvdev
13 Replies
3. Shell Programming and Scripting
Guys,
My log files stored in the date format format below(log_20080714072942):
TIMESTAMP=`date +%Y%m%d%H%M%S`
LOG=/log/log_${TIMESTAMP}.log
I'm looking for a shell script which deletes all files which is older than 3 months from today.
Regards,
Bhagat (3 Replies)
Discussion started by: bhagat.singh-j
3 Replies
4. Shell Programming and Scripting
Hi,
I have a very urgent requirement here. I have to find all files in the specified directory but not in the sub directories(The directory name is stored in a variable) which are older than the current date as well as current time and rename it as filename_yyyymmddhhmmss.ext and move it into a... (7 Replies)
Discussion started by: ragavhere
7 Replies
5. Shell Programming and Scripting
Hello,
I want to gzip files in a folder in bulk i.e. all files older than 1 month should be in *.gz format. Could you please suggest how this can be achieved. Thanks.
Regards,
Alok (1 Reply)
Discussion started by: alok1301
1 Replies
6. Shell Programming and Scripting
Hi Gurus
the count of files in a particular Directory...
ls -lrth | grep -c ^-
can any one share the command to Count the files which is Older than 3 months
So please help me out in this
Thanks in Advance (2 Replies)
Discussion started by: SeenuGuddu
2 Replies
7. UNIX and Linux Applications
Can anyone explain why Firefox 10 keeps losing history older than 2 months? (1 Reply)
Discussion started by: cokedude
1 Replies
8. Red Hat
ENVIROMENT
Linux: Fedora Core release 1 (Yarrow)
iPlanet: iPlanet-WebServer-Enterprise/6.0SP1
Log Path: /usr/iplanet/servers/https-company/logs
I have iPlanet log rotation enabled rotating files on a daily basis.
The rotated logs are NOT compressed & are taking up too much space.
I... (7 Replies)
Discussion started by: zachs
7 Replies
9. Shell Programming and Scripting
I have a qnap TS259 that is running ubuntu. Have successfully setup back scripts that are initiated by cron.
I would like to create a couple scrypts that would operate on the recycle bins for both drives. Just want to be able to run the script manually that would walk through both directories... (13 Replies)
Discussion started by: mackconsult
13 Replies
10. Shell Programming and Scripting
Hi,
I am writing the script for tomcat logs clean up ending with *.txt and *.log.
cleanup should be applied to logs older than 7 days logs same will be scheduled in cron.
after googling found below but it only help partially.
find . -type f -name '*.log' -exec truncate --size 0 "{}" \;
I... (6 Replies)
Discussion started by: Riverstone
6 Replies