Skip to content

Commit 0cb8b7d

Browse files
committed
Merge branch 'master' of github.com:hazcod/macbac
2 parents df941db + 5fa8863 commit 0cb8b7d

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ Lists, controls and schedules efficient APFS snapshots for your convenience.
66
```shell
77
# let's take space efficient APFS snapshots every hour
88
# knowing they get cleaned up if necessary
9-
% ./macbac.sh schedule hourly
10-
Removing previous schedule...
11-
Removed previous snapshot schedule.
9+
% macbac schedule hourly
1210
Installing daemon config to /Users/user/Library/LaunchAgents/com.hazcod.macbac.plist
1311
Loading config to enable schedule...
1412
Scheduled hourly snapshots!
@@ -34,7 +32,7 @@ Pruning snapshot 2021-02-04-155845 (1/1)
3432

3533
## How does it work?
3634

37-
It's a convenient wrapper around `tmutil`.
35+
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.
3836

3937
## Installation
4038

macbac.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ disable() {
228228
}
229229

230230
getVolumes() {
231-
ls -d /Volumes/*
231+
ls -1d /Volumes/*
232232
}
233233

234234
getSnapshots() {
@@ -254,9 +254,13 @@ listStatus() {
254254
}
255255

256256
listSnapshots() {
257-
volumes=$(getVolumes)
257+
declare -a volumes
258258

259-
for volume in $(getVolumes); do
259+
while read -r line; do
260+
volumes+=("$line")
261+
done <<< $(getVolumes)
262+
263+
for volume in "${volumes[@]}"; do
260264
# show current volume
261265
echo -e "${BOLD}${volume}${NC}"
262266

0 commit comments

Comments
 (0)