Cron Job Newbie help - Checkpoint Firewall mgmt server cleaning up logs

in Off-Topic
Can someone help me finalize this cron job. The goal is to have fully automated cron job which runs weeknights @ 4am doing a search for any logs older than 50 days and larger than 1mb and deletes them. 0 4 * * 1,2,3,4,5 find /opt/CPsuite-R77/fw1/log -size +1000k -mtime +50 -name "*.log" -exec rm -r {} \; Logs are located in the following directory /opt/CPsuite-R77/fw1/log
Comments
sudo crontab -e -u username
If you look at the man pages you can see some explanations on how to configure times/dates:
man 5 crontab
You can do a simple 1-5 to cover weekdays:
0 4 * * 1-5 find /opt/CPsuite-R77/fw1/log -size +1000k -mtime +50 -name "*.log" -exec rm -r {} \;
If you want to add a user its just:
useradd username
To set the password
passwd username
Never used "Gai", can't help you there.
Less code, if your into that.
IMO, run it from the CLI first, and once you are satisfied, then place it into a cron job.
http://www.thegeekstuff.com/2013/12/xargs-examples/
xargs: How To Control and Use Command Line Arguments
"Its easier to deceive the masses then to convince the masses that they have been deceived."
-unknown
To list current cron jobs tied to what user you are logged in as...
and
To them modifications to that user's crontab.
However depending on who is administering that system, crontab maybe blocked by either cron.allow or cron.deny.
"Its easier to deceive the masses then to convince the masses that they have been deceived."
-unknown