I have a script which dumps out database and uploads the SQL file to Swift. I've run into the issue where the script runs fine in terminal but fails in cron.
A bit of debugging and I found that the /usr/local/bin/swift
command is not found in the script.
Here's my crontab entry:
*/2 * * * * . /etc/profile; bash /var/lib/postgresql/scripts/backup
Here's what I've tried:
- Using full path to
swift
as/usr/local/bin/swift
- Executing the
/etc/profile
script before executing the bash script.
How do I solve this?
which swift
and that returns empty. Beyond that,$?
returns1
. Am I missing something?/etc/crontab
.postgres
user.