
cron
ファイルを解凍して実行する必要があることがあります。cron
.zipファイルを解凍、実行、削除するように設定します。うまくいきましたが、ファイルを削除しませんでした。これはcron
:
/usr/bin/wget -q -nd --delete-after 'url of plugin to execute the file'
cron
フォルダから15日以上古いファイルを削除する2番目のファイルを追加しようとしましたが、これは最初のファイルcron
の正常な実行を「妨げる」ようです。
私が使用する2番目のものは次のcron
とおりです。
/usr/bin/find /directory/ -mtime +15 -exec /bin/rm {} \; > /dev/null 2>&1
答え1
私は次のようにします:
#!/bin/sh
#
/usr/bin/wget -q -nd --delete-after 'url of plugin to execute the file'
if [ $? = 0 ] ; then
/usr/bin/find /directory/ -mtime +15 -exec /bin/rm {} \; > /dev/null 2>&1
fi
必要に応じて自由に修正してください。