문서의 이전 판입니다!
/etc/cron.{daily,weekly,monthly}
에 지정된 job 들이 anacron 을 통해 실행되게 돼 있어서, 해당 job들은 PC가 꺼져도 다시 켜진뒤에 job 실행이 보장된다(hourly는 워낙 자주 실행되므로 제외).#!/bin/sh # If started as root, then re-start as user "gavenkoa": if [ "$(id -u)" -eq 0 ]; then # root는 id가 0 exec sudo -H -u gavenkoa $0 "$@" # 핵심부. echo "This is never reached."; fi echo "This runs as user $(id -un)"; # prints "gavenkoa" exit 0;
# /var/log/syslog 로 남기기 somecmd 2>&1 | logger -i