I have 3 nice commands that are dumping some databases, and compress assets for a backup. After that, the files should be copied to another server. I'm using this command:nice mysqldump -u user1 -p'XXX' database1 | gzip > database1.sql.gznice mysqldump -u user2 -p'XXX' database2 | gzip > database2.sql.gznice zip -r assets.zip /var/www/site1/assets/cd ..scp -R backups user@backupserver.com:/home/user/backupsMy problem is, that the scp commands seems to get executed, BEFORE the nice commands are finished. This leads to partial SQL dumps, and sometimes broken zip files.So how can I be sure, that all 3 nice commands are finished, before copying the files to another server?
Run command after nice command has finished
backup;scp;scheduling;nice