Quantcast
Channel: Check if a screen is active and then display countdown - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2

Check if a screen is active and then display countdown

0
0
#!/bin/bash
DATE=$(date +"%m-%d-%Y")
Backup_from="/home/mc/server/prison/"
Backup_to="/home/mc/backups/PRISON-$DATE.tar" 

echo "Starting backup of $Backup_from to $Backup_to"
screen -dmS backup tar -zcvpf $Backup_to $Backup_from
if ! screen -list | grep -q "backup"; then
    for i in {10..1};do echo -n "$i." && sleep 1; done 
fi
echo "Done" 

This is my current backup script, I want it to show a countdown while the screen is active. But then stop when its inactive/removed/deleted.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images