Hi I've set my crontab as follows :

30 17 * * * sh /bin/automysqlbackup.sh.2.5

The script I'm using to function as a cron job is a database backup script, which is automysqlbackup .So by right my daily backups should be at 5.30 p.m in the evenings.

But I noticed that my database does not backup on Saturdays. It backs up on Sundays, but not Saturdays.
There is another default crontab scipt in the /etc directory :

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

Does this play a part in not creating a backup on Saturdays?

I do not know why this should affect the backing up because I've not placed the automysqlbackup script in the cron.daily directory.

Why does the database not backup on Saturdays at all, but does backup on Sundays at 5.30 p.m?

Your first cron should run at 5:30 *every* day, the first thing I would check is /var/log/cron and make sure that the cron task is actually running. One limitation might be if you have "access times" configured for your user account, since cron will need to execute as that user.

your file name is automysqlbackup.sh.2.5
rename it from automysqlbackup.sh.2.5 to automysqlbackup.sh
i think it will work

Hi I've set my crontab as follows :

The script I'm using to function as a cron job is a database backup script, which is automysqlbackup .So by right my daily backups should be at 5.30 p.m in the evenings.

But I noticed that my database does not backup on Saturdays. It backs up on Sundays, but not Saturdays.
There is another default crontab scipt in the /etc directory :

Does this play a part in not creating a backup on Saturdays?

I do not know why this should affect the backing up because I've not placed the automysqlbackup script in the cron.daily directory.

Why does the database not backup on Saturdays at all, but does backup on Sundays at 5.30 p.m?

Hi....

1) tracedinesh is right first of all change your file name and make that executable. Then you don't need to mention sh in the crontab.

2) Try to list down crontab entries other then root user e.g (crontab -l -u <username>)

3) Check your system date/time

Might also help to dump the output of each cron run to a log file in case it is running, but giving you an error by appending "> /tmp/crondaily.out" (one for each).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.