If I run my backup script manually from the command line it works fine. No issue backup is created. In the crontab log, I can see the entry for running the backup at 2:00 AM,
Dec 23 01:01:01 mapehr anacron: Anacron started on 2019-12-23 Dec 23 01:01:01 mapehr anacron: Normal exit (0 jobs run) Dec 23 01:01:01 mapehr run-parts(/etc/cron.hourly): finished 0anacron Dec 23 02:00:01 mapehr CROND: (sgaddis) CMD (sgaddis /bin/bash /home/sgaddis/copy-production-db.sh) Dec 23 02:01:01 mapehr CROND: (root) CMD (run-parts /etc/cron.hourly) Dec 23 02:01:01 mapehr run-parts(/etc/cron.hourly): starting 0anacron Dec 23 02:01:01 mapehr anacron: Anacron started on 2019-12-23
but when I look in the
/home/sgaddis/backup there is no backup.
It should not be a permission issue since it is my home/backup folder. My account should have the right to dump the backup there as it does when I run the script manually. Any place else I should be looking for clues?
I went to https://linux4one.com/how-to-set-up-cron-job-on-centos-7/ to see if there was anything I left out in creating the cronjob
I searched this site was unable to find a question similar to this one. The cronjob is not hanging or not being executed. The closest I found was
but as I said earlier in my post I have already run the script from the command line and it works fine so the above post does not answer my question.
does not produce a similar question to the one that I have posted. If you know of a similar post please point it out and not just vote down my post.
The exact line is this
0 2 * * * root /bin/bash /home/sgaddis/copy-production-db.sh
This is the command that is in the log file today.
mapehr CROND: (sgaddis) CMD (/bin/bash /home/sgaddis/copy-production-db.sh)
Now it is using my user account to launch the cron job.
Maybe my user account does not have permission to execute a cron job?