joeyates / imap-backup

Backup and Migrate IMAP Email Accounts
MIT License
1.33k stars 74 forks source link

Backup not running via script which is ran by root triggered with cron. #146

Closed Tom5421 closed 1 year ago

Tom5421 commented 1 year ago

Hi,

I have tried the following lines in my script, neither of them are working. I don't get any output when I use the --verbose option and pipe to a file either.

imap-backup backup --config /opt/mail-backup/config.json

imap-backup --config /opt/mail-backup/config.json

To clarify, if I manually run the script it works completely fine, it is only when the script is triggered by cron that this does not run. I know the rest of the script runs since the other part of the backup solution is working fine.

joeyates commented 1 year ago

Hi @Tom5421

Could you post the exact content of your cron file? Thanks!

Tom5421 commented 1 year ago

Hey,

I've just figured out why it wasn't running, it wasn't in the Cron environment so I have now fixed it by calling it like this: /usr/local/bin/imap-backup backup --config /opt/mail-backup/config.json

Thanks!