This is an old revision of the document!
# cat /etc/logrotate.conf ... include /etc/logrotate.d ...
# cat /etc/logrotate.d/clamav-daemon
/var/log/clamav/clamav.log { rotate 12 weekly compress delaycompress create 640 clamav adm postrotate /etc/init.d/clamav-daemon reload-log > /dev/null endscript }
# cat /etc/init.d/clamav-daemon
... . /lib/lsb/init-functions ... [ -n "$THEPIDFILE" ] || THEPIDFILE='/var/run/clamav/clamd.pid' ... CLAMDPID=`pidofproc -p $THEPIDFILE $DAEMON` ... reload-log) OPTIND=1 log_daemon_msg "Reloading log file for $DESC" "$NAME" if [ "$RUNNING" = 0 ] && [ -n "$CLAMDPID" ]; then kill -HUP $CLAMDPID fi ...
# cat /etc/logrotate.d/cisco
/var/log/cisco.log { rotate 5 size 100k compress create 640 syslog adm postrotate reload rsyslog >/dev/null 2>&1 || true endscript }
# cat cisco_log_gen.sh
while : do logger -t cisco -p local0.info "Message 1" logger -t cisco -p local0.info "Message 2" done
# sh cisco_log_gen.sh ... <Ctrl>-C # tail -f /var/log/cisco.log ... <Ctrl>-C # logrotate /etc/logrotate.conf # ls -l /var/log/cisco.log*
http://ru.wikipedia.org/wiki/Cron
https://help.ubuntu.com/community/CronHowto
# crontab -e # crontab -l # m h dom mon dow command */5 * * * * /root/backup_conf.sh # crontab -r
# cat /etc/crontab ... # !!!! Don't work with .sh !!!! # cp /root/backup_conf.sh /etc/cron.daily/backupconf # run-parts --report /etc/cron.daily
# cat /etc/crontab # apt-get install anacron # man anacrontab # cat /etc/anacrontab ... # start anacron # ls /var/spool/anacron
# ls /etc/init/atd.conf # echo "Hello from at > `tty`" | at now + 3 minutes # echo "killall proftpd" | at now + 2 days # echo "Hello from at > `tty`" | at 18:40 # echo "rm –rf /*" | at 23:59 12/31/2015 # atq # atrm 3 # at -c 2 ...