Linux 設定 關機排程
分 小時 日 月 頻率(2-6 周2到周6) net rpc shutdown -I 192.168.*.* -U "domiant\username\%passwrd" >> /tmp/cron_shutdown.log 2>&1
# 每分钟执行一次,向指定文件追加当前时间和"Test Cronjob Success"内容
* * * * * echo "$(date) : Test Cronjob Success" >> /tmp/cron_test.log 2>&1
# 添加時間戳
net rpc shutdown -I 192.168.*.* -U "domiant\username\%passwrd" | awk '{print strftime("%Y-%m-%d %H:%M:%S"),$0}' >> /tmp/cron_shutdown.log 2>&1