タグ

ブックマーク / dharry.hatenablog.com (2)

  • つい最近知ったcrontabのマクロ - harry’s memorandum

    cronの語源がギリシャ神話の時間の神クロノス(chronos/kronos)だったとはマジに知らなかった。 語源は別にしてcrontabマクロというのがあるんですね。こんな感じに@rebootとするとOS起動時に test.pl を実行してくれる。/etc/rc.localに書いておくようなものですね。 $ crontab -l @reboot /home/user/test.pl http://en.wikipedia.org/wiki/Cron#Predefined_scheduling_definitions Entry Description Equivalent To @yearly (or @annually) Run once a year 0 0 1 1 * @monthly Run once a month 0 0 1 * * @weekly Run once a we

    つい最近知ったcrontabのマクロ - harry’s memorandum
    homaju
    homaju 2010/09/27
    crontabで@rebootとすると再起同時に実行することができるとのこと。
  • 最近知ったLinux/UNIXの小技 - harry’s memorandum

    最近知って結構ショックを受けた。 touch hoge.txt と似たような機能。*1 $ > hoge.txt $ ls -l hoge.txt -rw-r--r-- 1 root root 0 Jul 10 03:15 hoge.txt lessでtail -f ができる。 $ sudo less +F /var/log/messages SSHでリモートサーバに対して色々 リモート先のファイルをsortして比較。パスフレーズなしにするか、ssh-agentを使用するかしてください。 $ diff <(sort /home/user/.bashrc) <(ssh user@hostname "sort /home/user/.bashrc") リモートサーバのファイルを編集 $ vim scp://user@hostname//home/user/.bashrc sambaのコマンドで

    最近知ったLinux/UNIXの小技 - harry’s memorandum
    homaju
    homaju 2010/07/12
    Windowsのシャットダウンもできるとは知らなかった
  • 1