--- file makebackup.sh
#!/bin/bash
mysqldump --all-databases | gzip -9 > /backup/temp_db.gz
tar -Pcf /backup/temp_ftp.tar /public_html/
tar -Pcf /backup/temp_backup.tar /home/temp_db.gz /backup/temp_ftp.tar
wait %%
/backup/upload.sh
--- file upload.sh
#!/usr/bin/expect -f
# connect via scp
spawn scp /backup/temp_backup.tar root@mybackup.com:/home/backup.tar
#######################
expect {
-re ".*es.*o.*" {
exp_send "yes\r"
exp_continue
}
-re ".*sword.*" {
exp_send "mypassword\r"
}
}
interact
When i look at /backup
folder i see all files are there. In proper size
When i look at destination site i see file that is 18 times less than what i have in source server in /backup
folder.
When i just run it as ./makebackup.sh
it works properly when i run trough cron it does not. Is there way to execute backup/upload.sh
ONLY once prior commands are finished?
15 12 * * 1,3,5 /backup/makebackup.sh 2>&1 >> /var/log/cron_makebackup.log
Cron log does not say anything at else than when i run it manually.