Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I Write script that make a zip file with /var/www Directory And mysqldump db And upload it via ftp And change mode to executable file And put It in cron tab

but file doesn't upload !!!

#!/bin/bash

mysqldump -u root -h localhost -p123456 --all-databases > /tmp/test/databases.sql
tar cfz /tmp/test/databases.sql /var/www /tmp/test/zip.tar.tgz

ftp -n <<EOF
open $server
user $user $password
put /tmp/test/zip.tar.tgz
EOF

Put it in crontab

          • ./script.sh

but when crontab has been worked , just the zip file was created and it doesn't uploaded

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.