Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hazcod/macbac
Browse files Browse the repository at this point in the history
  • Loading branch information
hazcod committed Oct 12, 2021
2 parents df941db + 5fa8863 commit 0cb8b7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ Lists, controls and schedules efficient APFS snapshots for your convenience.
```shell
# let's take space efficient APFS snapshots every hour
# knowing they get cleaned up if necessary
% ./macbac.sh schedule hourly
Removing previous schedule...
Removed previous snapshot schedule.
% macbac schedule hourly
Installing daemon config to /Users/user/Library/LaunchAgents/com.hazcod.macbac.plist
Loading config to enable schedule...
Scheduled hourly snapshots!
Expand All @@ -34,7 +32,7 @@ Pruning snapshot 2021-02-04-155845 (1/1)

## How does it work?

It's a convenient wrapper around `tmutil`.
It's a convenient wrapper around `tmutil` and basically replicates the local snapshot feature Time Machine would perform when you are backing up to a remote disk.

## Installation

Expand Down
10 changes: 7 additions & 3 deletions macbac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ disable() {
}

getVolumes() {
ls -d /Volumes/*
ls -1d /Volumes/*
}

getSnapshots() {
Expand All @@ -254,9 +254,13 @@ listStatus() {
}

listSnapshots() {
volumes=$(getVolumes)
declare -a volumes

for volume in $(getVolumes); do
while read -r line; do
volumes+=("$line")
done <<< $(getVolumes)

for volume in "${volumes[@]}"; do
# show current volume
echo -e "${BOLD}${volume}${NC}"

Expand Down

0 comments on commit 0cb8b7d

Please sign in to comment.