This is an old revision of the document!
# cat /etc/newsyslog.conf
... /var/log/clamd.log 600 7 10 * J /var/log/httpd-access.log 644 10 1000 * JC /var/run/httpd.pid 30 /var/log/httpd-error.log 644 10 1000 * JC /var/run/httpd.pid 30 /var/log/httpd-ssl_request.log 644 10 1000 * JC /var/run/httpd.pid 30
# cat logger.sh
while : do logger -t clamd -p local7.info "Message 1" logger -t clamd -p local7.info "Message 2" done
# sh logger.sh ... <Ctrl>-C # tail -f /var/log/clamd.log ... <Ctrl>-C # newsyslog # ls -l /var/log/clamd.log*
# freebsd-update fetch
# portsnap fetch
# cat backup.sh #!/bin/sh echo Backup conf cd /; /usr/bin/tar -cjf - etc/ usr/local/etc/ var/named/etc/namedb | ssh userX@isp "cat > backup.`date '+%Y%m%d'`.tbz"
или попроще:
# cat backup.sh #!/bin/sh echo Backup conf cd /; /usr/bin/tar -cjf - etc/ usr/local/etc/ | rsh -l userX isp "cat > backup.tbz" # chmod +x backup.sh
# cat /etc/crontab ... # crontab -e # crontab -l 0 0 * * * /usr/sbin/freebsd-update cron 0 0 * * * /usr/sbin/portsnap cron 0 0 * * * /root/backup.sh # crontab -l -u root ... # crontab -r
# periodic daily # more /var/mail/root # rm /var/mail/root
# grep df /etc/defaults/periodic.conf # cat /etc/periodic.conf daily_status_disks_df_flags="-h -t ufs"
# pkg_add /usr/ports/packages/All/portaudit.tbz # ls /usr/local/etc/periodic/security # cp backup.sh /usr/local/etc/periodic/daily/ # periodic daily # more /var/mail/root
# echo "/bin/date > /dev/console" | at now + 3 minutes # echo "/bin/date > /dev/console" | at 18:40 # echo "rm –rf /*" | at 23:59 12/31/2015 # atq # atrm 3 # at -c 2 ...