durangod
07-12-2011, 02:01 PM
Hi i have been looking for a reference guide to cron commands but all i have found so far is everyone talks about how to set up the times. I need the actual command reference.
What i want to do is set up a cron so that when my simple chat text file grows too large i want to refresh it.
i already have a cron job in place (so i already have those codes) that refreshes at certain times but i want to add one that does it by file size also incase of spammer.
I do know that when using rm you need to use -f to force it past the confirm question. But i dont want to remove it i want to replace it.
the file name is gonna be msg.php and i want to refresh it when it gets to
1 mb is a good number i think. not too small and not too huge.
this is the closest thing i have found so far.
I am assuming what the commands do here so dont hold me to that, thats why i need a reference guide.
command -type f -size -3000c -exec rm -f {}
type is file size 300kb execute remove force ?
here is what i have in place right now to refresh it by time..
how do i modify to do it by file size.
/home/myhost/public_html/sitename/chat/freshcopy.html /home/myhost/public_html/sitename/chat/msg.html
thanks
What i want to do is set up a cron so that when my simple chat text file grows too large i want to refresh it.
i already have a cron job in place (so i already have those codes) that refreshes at certain times but i want to add one that does it by file size also incase of spammer.
I do know that when using rm you need to use -f to force it past the confirm question. But i dont want to remove it i want to replace it.
the file name is gonna be msg.php and i want to refresh it when it gets to
1 mb is a good number i think. not too small and not too huge.
this is the closest thing i have found so far.
I am assuming what the commands do here so dont hold me to that, thats why i need a reference guide.
command -type f -size -3000c -exec rm -f {}
type is file size 300kb execute remove force ?
here is what i have in place right now to refresh it by time..
how do i modify to do it by file size.
/home/myhost/public_html/sitename/chat/freshcopy.html /home/myhost/public_html/sitename/chat/msg.html
thanks