
smithia6
New User
Aug 10, 2011, 8:49 PM
Post #1 of 2
(13880 views)
|
Perl script to find file 1 day old and move it and rename.
|
Can't Post
|
|
Hi I have never used perl before, I have cashe files being generated by a news feed I have on my website, they are .xml files with a long random number in front of the file name, so what I want to do is have a perl script to check a specific directory for any files a day old and move them out of there and place it into another specified directory renaming it to (yesterdays date).xml It is only one file a day created, so I have a task scheduler on my webserver control panel so I could run this job say 1am everyday automatic. The file names look like this : 677e8f3a88be40d3ead789faec519a9f.xml stored in /home/users/carp/autocashe I would like it to be moved into /home/users/archive/news with a file name like 11082011.xml (date/month/year) I have read lots of snippets on this but I have no idea where to start. It is a linux webserver Please please please could someone help. Regards Ian
|