Improved cron support

Now calls mount and unmount using absolute path
This commit is contained in:
amarcu5
2018-04-30 00:40:34 +01:00
parent acd7addc9a
commit 8c3ef6cae9

View File

@@ -74,7 +74,7 @@ func DeleteShadowCopy() {
return return
} }
err := exec.Command("umount", "-f", snapshotPath).Run() err := exec.Command("/sbin/umount", "-f", snapshotPath).Run()
if err != nil { if err != nil {
LOG_ERROR("VSS_DELETE", "Error while unmounting snapshot") LOG_ERROR("VSS_DELETE", "Error while unmounting snapshot")
return return
@@ -158,7 +158,7 @@ func CreateShadowCopy(top string, shadowCopy bool, timeoutInSeconds int) (shadow
// Mount snapshot as readonly and hide from GUI i.e. Finder // Mount snapshot as readonly and hide from GUI i.e. Finder
_, err = CommandWithTimeout(timeoutInSeconds, _, err = CommandWithTimeout(timeoutInSeconds,
"mount", "-t", "apfs", "-o", "nobrowse,-r,-s=com.apple.TimeMachine." + snapshotDate, "/", snapshotPath) "/sbin/mount", "-t", "apfs", "-o", "nobrowse,-r,-s=com.apple.TimeMachine." + snapshotDate, "/", snapshotPath)
if err != nil { if err != nil {
LOG_ERROR("VSS_CREATE", "Error while mounting snapshot: ", err) LOG_ERROR("VSS_CREATE", "Error while mounting snapshot: ", err)
return top return top