Nunes
Nunes

Reputation: 15

GZIP not running with crontab

I'm creating a crontab to run the scriptA.sh everyday at midnight

0 0 * * * . /config/scripts/scriptA.sh 2>&1

The scriptA.sh has the following configuration:

 /bin/gzip /logs_backup -q *;

When I execute the script, outside of crontab, the script runs perfectly, compressing all the files inside of logs_backup folder. However when the scriptA.sh is being called by crontab, it doesen't works.

I'm using the right path for gzip.

# which gzip
/bin/gzip

How I can put this script to works with crontab?

Looking for your comments and support.

Upvotes: 0

Views: 842

Answers (1)

Francesco Gasparetto
Francesco Gasparetto

Reputation: 1963

Change this line

/bin/gzip /logs_backup -q *;

with this

/bin/gzip /logs_backup -q /backup/directory/*;

replacing with your real backup directory

Upvotes: 1

Related Questions