how to set bash with time in Linux
How to take snapshots in VirtualBox using sh file
How to take snap
01 type cd /usr/bin
then showing like this
./add1.sh
that way make take snapshot using sh on linux
now we try make delete snapshot using sh
sudo nano delete1.sh
sleep `echo $(VBoxManage snapshot "lubuntu64 bits" delete "now")` # Place >
after run
sudo chmod +x delete1.sh
./delete1.sh
make new sh call summary.sh
sudo nano summary.sh
after
sudo echo "/usr/bin/add1.sh" | at 1:00Am
sudo echo "/usr/bin/add1.sh" | at 2:00Am
sudo echo "/usr/bin/add1.sh" | at 3:00Am
sudo echo "/usr/bin/add1.sh" | at 4:00Am
sudo echo "/usr/bin/add1.sh" | at 5:00Am
sudo echo "/usr/bin/add1.sh" | at 6:00Am
sudo echo "/usr/bin/add1.sh" | at 9:00Am
sudo echo "/usr/bin/add1.sh" | at 12:00pm
sudo echo "/usr/bin/add1.sh" | at 3:00pm
sudo echo "/usr/bin/add1.sh" | at 6:00pm
sudo echo "/usr/bin/add1.sh" | at 9:00pm
sudo echo "/usr/bin/delete1.sh" | at 1:05Am
sudo echo "/usr/bin/delete1.sh" | at 2:05Am
sudo echo "/usr/bin/delete1.sh" | at 3:05Am
sudo echo "/usr/bin/delete1.sh" | at 4:05Am
sudo echo "/usr/bin/delete1.sh" | at 5:05Am
sudo echo "/usr/bin/delete1.sh" | at 6:05Am
sudo echo "/usr/bin/delete1.sh" | at 9:05Am
sudo echo "/usr/bin/delete1.sh" | at 12:05pm
sudo echo "/usr/bin/delete1.sh" | at 3:05pm
sudo echo "/usr/bin/delete1.sh" | at 6:05pm
sudo echo "/usr/bin/delete1.sh" | at 9:05pm
copy the above time schedule you can change it as you want
sudo chmod +x summary.sh
if you show an error then you should install at as bellow
sudo apt install at
try this way
sudo nano everyday.sh
#!/bin/bash
while ( true ); do
before=`date +%s`
sleep `echo "/usr/bin/summary.sh" | at 11:16pm` # Place your command here
after=`date +%s`
DELAY=`echo "86400-($after-$before)" | bc`
sleep $DELAY
done
after
sudo chmod +x everyday.sh
after
./everyday.sh
if you have any issues message us we will help you
thank you
1 Comments
Good job
ReplyDelete