How do I know if a time machine backup is running?
5
votes
4
answers
4515
views
Due to [APFS having a mind of its own](https://www.reddit.com/r/mac/comments/75shcg/how_to_disable_time_machine_localmobile_backup/) and filling the hard disk with unwanted snapshots, I made a cron to run
tmutil deletelocalsnapshots xxx
. Later I found out that running this command while a backup is in progress will stop the backup. How can I know if a time machine backup is in progress to avoid running the command? The man page for tmutil
doesn't list any status command.
Right now I'm doing the following in the script, since now backups mount at /Volumes/Time Machine Backups/
:
ls -d /Volumes/Time* 2>/dev/null|grep Machin >/dev/null
if [[ $? != 0 ]]; then
# run here tmutil snapshot deletion commands
fi
However, this doesn't seem to be very precise. The volume may be mounted some minutes later after a backup has started, and also stopping a backup leaves that mounted volume for a while. Finally, the name of the mounted volume might change in the future, making the check useless.
Asked by Grzegorz Adam Hankiewicz
(301 rep)
Feb 24, 2018, 06:20 PM
Last activity: Oct 5, 2024, 11:49 AM
Last activity: Oct 5, 2024, 11:49 AM