Jump to content

Archived

This topic is now archived and is closed to further replies.

rodin

Delete Files if older than x hours, copy placefile

Recommended Posts

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!

Share this post


Link to post
Share on other sites
[!--quoteo(post=386673:date=Jun 21 2006, 06:58 PM:name=rodin)--][div class=\'quotetop\']QUOTE(rodin @ Jun 21 2006, 06:58 PM) [snapback]386673[/snapback][/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!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.