Make five cPanel backup process start one by one, not at the same time, in a bash script
Budget: $10 – $30 USD
You need to have cPanel WHM inorder to test your script. if you don't have WHM Cpanel with SSH access you are not qualify this job.
I have a bash script that backs up five cPanel users and sends it to the FTP server. My problem is that when I run this bash script, all five start at the same time, creating five pigz processes. Although I use ";" at the end of each line, I still couldn't achieve what I was hoping for. What I would like to achieve is:
a) Start the bash script.
b) Some commands to check the "(pigs)" named process every 10 seconds if pigs still in progress
c) If the pigs process does not work anymore, which means the backup is complete, then proceed to the next one, which is a2, followed by a3, a4, and a5.
#!/bin/sh
a1="cpapi1 --user=cpaneluser1 Fileman fullbackup passiveftp 192.168.0.5 ftpuser ftppassword my(at)backup.com.au 21 ftpdirectory/backup2/daily"
a2="cpapi1 --user=cpaneluser2 Fileman fullbackup passiveftp 192.168.0.5 ftpuser ftppassword my(at)backup.com.au 21 ftpdirectory/backup2/daily"
a3="cpapi1 --user=cpaneluser3 Fileman fullbackup passiveftp 192.168.0.5 ftpuser ftppassword my(at)backup.com.au 21 ftpdirectory/backup2/daily"
a4="cpapi1 --user=cpaneluser4 Fileman fullbackup passiveftp 192.168.0.5 ftpuser ftppassword my(at)backup.com.au 21 ftpdirectory/backup2/daily"
a5="cpapi1 --user=cpaneluser5 Fileman fullbackup passiveftp 192.168.0.5 ftpuser ftppassword my(at)backup.com.au 21 ftpdirectory/backup2/daily"
$a1; $a2; $a3; $a4; $a5;
What I require is for you to make a bash script on your server, then send it to me to test.
I have a bash script that backs up five cPanel users and sends it to the FTP server. My problem is that when I run this bash script, all five start at the same time, creating five pigz processes. Although I use ";" at the end of each line, I still couldn't achieve what I was hoping for. What I would like to achieve is:
a) Start the bash script.
b) Some commands to check the "(pigs)" named process every 10 seconds if pigs still in progress
c) If the pigs process does not work anymore, which means the backup is complete, then proceed to the next one, which is a2, followed by a3, a4, and a5.
#!/bin/sh
a1="cpapi1 --user=cpaneluser1 Fileman fullbackup passiveftp 192.168.0.5 ftpuser ftppassword my(at)backup.com.au 21 ftpdirectory/backup2/daily"
a2="cpapi1 --user=cpaneluser2 Fileman fullbackup passiveftp 192.168.0.5 ftpuser ftppassword my(at)backup.com.au 21 ftpdirectory/backup2/daily"
a3="cpapi1 --user=cpaneluser3 Fileman fullbackup passiveftp 192.168.0.5 ftpuser ftppassword my(at)backup.com.au 21 ftpdirectory/backup2/daily"
a4="cpapi1 --user=cpaneluser4 Fileman fullbackup passiveftp 192.168.0.5 ftpuser ftppassword my(at)backup.com.au 21 ftpdirectory/backup2/daily"
a5="cpapi1 --user=cpaneluser5 Fileman fullbackup passiveftp 192.168.0.5 ftpuser ftppassword my(at)backup.com.au 21 ftpdirectory/backup2/daily"
$a1; $a2; $a3; $a4; $a5;
What I require is for you to make a bash script on your server, then send it to me to test.