R
R
Roma Antonyuk2017-09-18 11:39:26
linux
Roma Antonyuk, 2017-09-18 11:39:26

How to fix amazon sync issue?

there is a sh script written that makes a backup of the database and uploads it to amazon.

#!/bin/bash
#get the day of week as a number (i.e. 1 = Monday, 7 = Sunday)
#backup 'my_database' to the folder /var/local/backups/mysql/
#$DAY_OF_WEEK is appendend to the file's name in order to keep a weekly history of the backups
mysqldump -u root -p3uUtcLLm online-tour > /var/local/online-tour-back1.sql
#use aws (Amazon's tool) to sync your backups to Amazon S3
#/usr/local/bin/aws - absolute path to Amazon's CLI tool
#s3 - the service we want to use
#sync - the command to run
#/var/local/backups/mysql/ - local folder
#s3://my-backups/mysql/ - Amazon s3 folder
aws s3 sync /var/local s3://apstay2017/Databases/

my crontab
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
33 *    * * *   root    /bin/bash /var/autobackup.sh
#

The problem is that the backup is made but it is not uploaded to Amazon.
What did I go wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Verbin, 2017-09-18
@rez0n

It seems to me that the problem may be that the path to the aws utility is not quite correctly specified in your script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question