When you say "save this code as mine.sh" , do you mean opening a text file then saving it as mine.sh in my cgminer folder? e.g. /home/pi/git/vtoang/cgminer/mine.sh?
Yes open your text editor and save it as mine.sh. You can put it in any folder, just home folder is easiest. You also have to mark it as an executing file. You can do it through the GUI by right clicking on file, select properties, then the permissions tab and check the box for executing.
Can I run a similar file for more instances such as mine2.sh and mine3.sh? I run more than one instance for different R606' and Newpac's.
I would just add an additional line for each instance to your script and just run the one script.
What would be the script to reboot the Pi4 weekly (e.g. 0100hrs every Monday) then to reboot each cgminer .sh file every 24hrs?
I would use crontab for the weekly reboot, this is what it is made for.
Then add this as last line
Does running the auto-reboot script commence from executing the .sh file and how would that conflict with the Pi4 reboot timing per week?
It won't conflict. The script just waits for a certain amount of seconds to have gone by.
Would sleep 86400 = 24hrs?
Yes, it is in seconds.
Whats the sleep 4 at the end for?
Just to give it some time to shutdown the first instance, so there is no conflict.