Quantcast
Viewing latest article 2
Browse Latest Browse All 2

Check if a screen is active and then display countdown

#!/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 latest article 2
Browse Latest Browse All 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>