mailgun电子邮件附件cronjob

时间:2017-10-20 12:29:19

标签: bash ubuntu cron mailgun

我有一个带有以下内容的bash脚本,当我直接运行它时它工作正常,如果我将它添加到cron作业,则附件失败。

    #!/bin/bash
echo "Clearing the files"
rm -f ci/assets/*.csv
sleep 10
echo "Shot report..."
node ci/export-shot.js
echo "Not shot report..."
node ci/export-not-shot.js
echo "Retouching delivered report..."
node ci/export-retouching-delivered.js
echo "Sending email"
curl -s --user 'api:key-6gdgdfg852fgggy4893g-t5cjgfseerwefgfdgdf2183' \
https://api.mailgun.net/v3/test.co/messages \
-F from='Openly Report Bot <report-bot@test.co>' \
-F to='kirthan.b@test.co' \
-F subject="`date -v-1d +%F` : Shot/Not Shot/Delivered Articles" \
-F text='Daily report of shot, not shot and delivered articles' \
--form-string html='<html>HTML version of the body</html>' \
-F attachment=@ci/assets/shot.csv \
-F attachment=@ci/assets/not-shot.csv \
-F attachment=@ci/assets/delivered.csv \

请帮我解决这个问题。

0 个答案:

没有答案