support removing objects from borg
This commit is contained in:
parent
bfdaee234f
commit
69d4b84501
1 changed files with 14 additions and 1 deletions
|
@ -98,7 +98,7 @@ gen r u rc gc rs = do
|
||||||
-- actions will never be used.
|
-- actions will never be used.
|
||||||
, storeExportWithContentIdentifier = storeExportWithContentIdentifier importUnsupported
|
, storeExportWithContentIdentifier = storeExportWithContentIdentifier importUnsupported
|
||||||
, removeExportDirectoryWhenEmpty = removeExportDirectoryWhenEmpty importUnsupported
|
, removeExportDirectoryWhenEmpty = removeExportDirectoryWhenEmpty importUnsupported
|
||||||
, removeExportWithContentIdentifier = removeExportWithContentIdentifier importUnsupported
|
, removeExportWithContentIdentifier = removeExportWithContentIdentifierM borgrepo
|
||||||
}
|
}
|
||||||
, whereisKey = Nothing
|
, whereisKey = Nothing
|
||||||
, remoteFsck = Nothing
|
, remoteFsck = Nothing
|
||||||
|
@ -343,3 +343,16 @@ retrieveExportWithContentIdentifierM borgrepo loc _ dest mkk _ = do
|
||||||
mkk
|
mkk
|
||||||
where
|
where
|
||||||
(archivename, archivefile) = extractImportLocation loc
|
(archivename, archivefile) = extractImportLocation loc
|
||||||
|
|
||||||
|
removeExportWithContentIdentifierM :: BorgRepo -> Key -> ImportLocation -> [ContentIdentifier] -> Annex ()
|
||||||
|
removeExportWithContentIdentifierM borgrepo _ loc _ = do
|
||||||
|
ok <- liftIO $ boolSystem "borg"
|
||||||
|
[ Param "recreate"
|
||||||
|
, Param (borgArchive borgrepo archivename)
|
||||||
|
, Param "--exclude"
|
||||||
|
, File (fromRawFilePath archivefile)
|
||||||
|
]
|
||||||
|
unless ok $
|
||||||
|
giveup "borg failed to remove the file"
|
||||||
|
where
|
||||||
|
(archivename, archivefile) = extractImportLocation loc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue