Hey all,
So I'm using the following script to tar a copy of a sql database and send it using ssh over to my backup server, but although the tar file shows up on the backup server, the tar doesnt have the files inside it that it should have. If I tar the file and dont redirect the tar over to my backup server then the files show up in the tar on the local server.
Any idea why the files arent transferring over?
So I'm using the following script to tar a copy of a sql database and send it using ssh over to my backup server, but although the tar file shows up on the backup server, the tar doesnt have the files inside it that it should have. If I tar the file and dont redirect the tar over to my backup server then the files show up in the tar on the local server.
Code:
#backup script for SOC projects filesystem/code and mysql database, to be executed weekly. ################################# a=$(date +%T-%d_%m_%Y) b=$(date +%m_%d_%Y) ################################# echo "mkdir /home/erind/socprojects_backups/".$b mkdir /home/erind/socprojects_backups/$b/ ################################ #echo "copying /var/www/html/SocProjects to /home/erind/socprojects_backups/$b/SocProjects".$a #cp -f -p -R /var/www/html/SocProjects /home/erind/socprojects_backups/$b/SocProjects.$a ############################### chown -Rf erind /home/erind/socprojects_backups/$b ############################### echo "dump socProjects sql database" mysqldump socProjects > /home/erind/socprojects_backups/$b/socProjects.$a.sql ############################## cd /home/erind/socprojects_backups/ echo "tar backup directory".$b tar -cfpz /home/erind/socprojects_backups/$b | ssh erind@remoteserver "cat > socProjects.$b.tar"
Comment