I have a shell / bash that works perfectly for making backups script, the problem is that I have large files that are giving problems running the script. The script has q compress the file in tar.gz
format and it does it, but when it comes in 6GB + or the script continues compressing the file but it goes in the next lines and backups is failed, the server must have a set_time_limit;
equal in php, the php file that calls the shell / bash I use set_time_limit (0);
and works very well, the shell / bash has something too?
The script:
MYSQLDUMP="$(which mysqldump)"
$MYSQLDUMP -u $DBUSER -h $DBHOST -p$DBPASS $DBNAME | gzip > $TIMESTAMP.sql.gz
ssh $USER_SSH@$HOST_SSH "tar -zcf - $HOME" > $TIMESTAMP.backup.tar.gz
tar -zcf $TIMESTAMP.tar.gz $TIMESTAMP.backup.tar.gz $TIMESTAMP.sql.gz
SUCCESS=$?
rm $TIMESTAMP.sql.gz
rm $TIMESTAMP.backup.tar.gz
I did not post the variables because I think it is not necessary
Before he finished tar it removes the 2 files with the final lines ... if the file is less than about 6GB or 7GB it does not happen this
$HOME
will be expanded locally not remotely, but this doesn't explain the problem. The only thing I would check is that there is no unusual setting ofRequestTTY
in.ssh/config
:yes
orforce
would be bad here.