こちらを参照
詳しい内容はこちらに書きました。
cron/crontab で 複数行の実行には波括弧 {} を使う - それマグで!
複数行のcrontab コマンドってかけないのかな
調べたけど、かけないことがわかった。
man によると
The ``sixth'' field (the rest of the line) specifies the command to be run. The entire command portion of the line, up to a newline or % character, will be executed by /bin/sh or by the shell specified in the SHELL variable of the crontab file. Percent-signs (%) in the command, unless escaped with back‐ slash (\), will be changed into newline characters, and all data after the first % will be sent to the command as standard input. There is no way to split a single command line onto multiple lines, like the shell's trailing "\".
記号 %
は改行として、sh に渡されるが、バックスラッシュを渡すようなものはない。って書いてありました。
残念。
ぐぐったら minix のcrontab は出来るっぽいけど、Linuxは無理ですね。
man に書いてないんだから、試すまでもないか
追記:できるっぽいので別エントリに
- cron/crontab で 複数行の実行には波括弧 {} を使う - それマグで!
- systemd timer job