Crontab Help

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
User avatar
Ownkruid
New to forums
New to forums
Posts: 6
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Thu Oct 29, 2015 1:13 am

Crontab Help

Post by Ownkruid »

Hi!

Yesterday I've hooked up all my servers with GOTV and made it so all the demos get automatically uploaded to my domain. I'm now wondering if it's possible to make a crontab that automatically deletes all demos older then x amount of days to save bandwidth. The domain is http://files.hosted.nfoservers.com/demos.

Much appreciated!

Jasper
Image
Image
Image
Image
Image
User avatar
Spray
Former staff
Former staff
Posts: 630
Joined: Wed Dec 28, 2011 10:41 pm
Location: Oregon

Re: Crontab Help

Post by Spray »

Give the following a try:

Code: Select all

0 0 * * * find ~/public/demos -mtime +7 -exec rm {} \;
This would remove files older than 7 days from the public/demos folder.
User avatar
Ownkruid
New to forums
New to forums
Posts: 6
Joined: Thu Oct 29, 2015 1:13 am

Re: Crontab Help

Post by Ownkruid »

Giving it a shot, I'll reply here with the results!

Much appreciated mate.
Image
Image
Image
Image
Image
User avatar
Ownkruid
New to forums
New to forums
Posts: 6
Joined: Thu Oct 29, 2015 1:13 am

Re: Crontab Help

Post by Ownkruid »

Worked!

Thank you! 8)
Image
Image
Image
Image
Image
Post Reply