#!/bin/bash echo "${0##*/}: starting new backup job master" while :; do if pgrep firefox &>/dev/null; then echo "${0##*/}: creating new i3 backup" i3-dump-layout-all echo "${0##*/}: i3 backup complete" else echo "${0##*/}: skipping i3 backup creation due to firefox not running. is the system in an unclean state?" fi sleep 5m done