IT_Architect
Verified User
- Joined
- Feb 27, 2006
- Messages
- 1,084
Since I'm working up a Linux VM, I'm using the opportunity to re-think my placement of cron and scripts.
Current FreeBSD;
/etc/crontab
Thoughts for AlmaLinux are:
Move SysAdmin Area into a file named custom inside cron.d
Move all scripts into /root/cron sub-directories such as:
/root/cron/anti-malware
/root/cron/watchdog
/root/cron/logs
etc.
- This enables me to very easily move custom stuff to a new server, not miss anything, and one place to check if things need edits with ReadMes for things that would
- When DirectAdmin and other software gets updated, they don't remove or obsolete anything.
- The only thing in the /root/cron structure is what I put there, unlike any of the /bins or /sbins
What are your thoughts?
Current FreeBSD;
/etc/crontab
yada yada bunch of stuff FreeBSD added here
Yada Yada bunch of stuff DirectAdmin added here.
# *****************************************************************************
# SysAdmin Area
# *****************************************************************************
##### Every day at 8:00 AM, clean out e-mails older than 30 days from the
# SYSTEM USER's mail boxes. Nobody ever checks them, and they are commonly
# used for cron output and E-mail catch-alls.
0 8 * * * root /home/admin/scripts/purge_system_acct_emails.sh
#
##### Anti-malware measures
# Scan server with ClamAV 30 minutes after the hour
28 * * * * root /etc/clamscan_delta.sh
# Scan server with ClamAV each day
0 2 * * 6 root /etc/clamscan_full.sh
##### SpamAssassin - Teach bayesian spam filter for the entire domain
/5 * * * * root /usr/bin/sa-teach_crawler 1
##### Check every minute and restart Apache if the one minute load average gets over 20 and e-mail [email protected].
* * * * * root /root/scripts/apache/apache_governor.sh
* * * * * root /root/scripts/php/php-fpm53_governor.sh
##### Check every minute for user flag to restart firewall for Admin Blacklist or Whitelist changes
* * * * * root /home/admin/scripts/admin.restart_firewall.sh
##### pf Firewal
0 3 * * * root /etc/pf/scripts/pf.script.emerging.sh
5 3 * * * root /etc/pf/scripts/pf.script.geo_blacklist.sh
##### Truncate log files every 15 minutes
yada yada yada
# *****************************************************************************
# END SysAdmin Area
# *****************************************************************************
yada yada stuff other software installs have appended to file
Thoughts for AlmaLinux are:
Move SysAdmin Area into a file named custom inside cron.d
Move all scripts into /root/cron sub-directories such as:
/root/cron/anti-malware
/root/cron/watchdog
/root/cron/logs
etc.
- This enables me to very easily move custom stuff to a new server, not miss anything, and one place to check if things need edits with ReadMes for things that would
- When DirectAdmin and other software gets updated, they don't remove or obsolete anything.
- The only thing in the /root/cron structure is what I put there, unlike any of the /bins or /sbins
What are your thoughts?