Revert "nixos: tarsnap - separate archive cachedirs"
This reverts commit 5f0253ace683bae4c7989f4db167676dd0a507e7. I didn't intend to push this - I meant to push it to *my fork's* remote...
This commit is contained in:
parent
5f0253ace6
commit
472a5192fd
@ -5,8 +5,8 @@ with lib;
|
|||||||
let
|
let
|
||||||
cfg = config.services.tarsnap;
|
cfg = config.services.tarsnap;
|
||||||
|
|
||||||
configFile = name: cfg: ''
|
configFile = cfg: ''
|
||||||
cachedir ${config.services.tarsnap.cachedir}/${name}
|
cachedir ${config.services.tarsnap.cachedir}
|
||||||
keyfile ${config.services.tarsnap.keyfile}
|
keyfile ${config.services.tarsnap.keyfile}
|
||||||
${optionalString cfg.nodump "nodump"}
|
${optionalString cfg.nodump "nodump"}
|
||||||
${optionalString cfg.printStats "print-stats"}
|
${optionalString cfg.printStats "print-stats"}
|
||||||
@ -57,12 +57,6 @@ in
|
|||||||
will refuse to run until you manually rebuild the cache with
|
will refuse to run until you manually rebuild the cache with
|
||||||
<command>tarsnap --fsck</command>.
|
<command>tarsnap --fsck</command>.
|
||||||
|
|
||||||
Note that each individual archive (specified below) has its own cache
|
|
||||||
directory specified under <literal>cachedir</literal>; this is because
|
|
||||||
tarsnap locks the cache during backups, meaning multiple services
|
|
||||||
archives cannot be backed up concurrently or overlap with a shared
|
|
||||||
cache.
|
|
||||||
|
|
||||||
Set to <literal>null</literal> to disable caching.
|
Set to <literal>null</literal> to disable caching.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
@ -257,7 +251,6 @@ in
|
|||||||
mkdir -p -m 0700 ${cfg.cachedir}
|
mkdir -p -m 0700 ${cfg.cachedir}
|
||||||
chown root:root ${cfg.cachedir}
|
chown root:root ${cfg.cachedir}
|
||||||
chmod 0700 ${cfg.cachedir}
|
chmod 0700 ${cfg.cachedir}
|
||||||
mkdir -p -m 0700 ${cfg.cachedir}/$1
|
|
||||||
DIRS=`cat /etc/tarsnap/$1.dirs`
|
DIRS=`cat /etc/tarsnap/$1.dirs`
|
||||||
exec tarsnap --configfile /etc/tarsnap/$1.conf -c -f $1-$(date +"%Y%m%d%H%M%S") $DIRS
|
exec tarsnap --configfile /etc/tarsnap/$1.conf -c -f $1-$(date +"%Y%m%d%H%M%S") $DIRS
|
||||||
'';
|
'';
|
||||||
@ -276,7 +269,7 @@ in
|
|||||||
|
|
||||||
environment.etc =
|
environment.etc =
|
||||||
(mapAttrs' (name: cfg: nameValuePair "tarsnap/${name}.conf"
|
(mapAttrs' (name: cfg: nameValuePair "tarsnap/${name}.conf"
|
||||||
{ text = configFile name cfg;
|
{ text = configFile cfg;
|
||||||
}) cfg.archives) //
|
}) cfg.archives) //
|
||||||
(mapAttrs' (name: cfg: nameValuePair "tarsnap/${name}.dirs"
|
(mapAttrs' (name: cfg: nameValuePair "tarsnap/${name}.dirs"
|
||||||
{ text = concatStringsSep " " cfg.directories;
|
{ text = concatStringsSep " " cfg.directories;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user