Jump to content


Photo

Delete Files if older than x hours, copy placefile


  • Please log in to reply
1 reply to this topic

#1 rodin

rodin
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 22 June 2006 - 12:58 AM

Hello All;
Trying to figure out a code to do something that is probably simple, but I'm not able to find anything to combine to make it happen..

Here is what i'd like to accomplish...

Check all files in /home/radar/kabc*.png --- if those files are older than x hours, delete them.
After deleting those files, I'd like to copy new "placefiles" in the place of the image, basically, copy test.png to kabc101.png (example filename). I'd like to not loop this process if the file size is equal to 123456 bytes exactly, and have the owner of those files a certain user.

What this is, is a radar software that I use to upload to my personal website, so if there's no weather going on, I don't use the radar software, and it's not updating the radar on the web, so, after so many hours of the software not uploading anything new, i'd like to find a way to have these placefiles put in place. Once I start my software again, it'll overwrite those files automatically.

Does this seem like it's possible? Is it an easy task? Anyone willing to help on this?

Thanks bunches!

#2 rodin

rodin
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 22 June 2006 - 10:35 PM

[!--quoteo(post=386673:date=Jun 21 2006, 06:58 PM:name=rodin)--][div class=\'quotetop\']QUOTE(rodin @ Jun 21 2006, 06:58 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hello All;
Trying to figure out a code to do something that is probably simple, but I'm not able to find anything to combine to make it happen..

Here is what i'd like to accomplish...

Check all files in /home/radar/kabc*.png --- if those files are older than x hours, delete them.
After deleting those files, I'd like to copy new "placefiles" in the place of the image, basically, copy test.png to kabc101.png (example filename). I'd like to not loop this process if the file size is equal to 123456 bytes exactly, and have the owner of those files a certain user.

What this is, is a radar software that I use to upload to my personal website, so if there's no weather going on, I don't use the radar software, and it's not updating the radar on the web, so, after so many hours of the software not uploading anything new, i'd like to find a way to have these placefiles put in place. Once I start my software again, it'll overwrite those files automatically.

Does this seem like it's possible? Is it an easy task? Anyone willing to help on this?

Thanks bunches!
[/quote]

No thoughts on this? is it even possible?

Thanks!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users