Skip to content

Instantly share code, notes, and snippets.

@satomixx
Created December 13, 2013 05:02
Show Gist options
  • Save satomixx/7939991 to your computer and use it in GitHub Desktop.
Save satomixx/7939991 to your computer and use it in GitHub Desktop.
月末にだけcronでbatchを叩きたい場合 && /dev/null や 2>&1 について ref: http://qiita.com/mugyuu/items/f835b42ab45ff6246039
55 23 28-31 * * /usr/bin/test $( date -d '+1 day' +\%d ) -eq 1 && perl /getsumatsu_batch.pl > /dev/null 2>&1
# 時間指定(28日から31日の23時55分) ⇒ なので実際には月末以外にも動いてはいます
55 23 28-31 * *
/usr/bin/test {hoge}
/usr/bin/test $( date -d '+1 day' +\%d ) -eq 1
$( date -d '+1 day' +\%d ) -eq 1
perl /getsumatsu_batch.pl
% ls >/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment