diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /modules/private/databases/utils.nix | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'modules/private/databases/utils.nix')
-rw-r--r-- | modules/private/databases/utils.nix | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/modules/private/databases/utils.nix b/modules/private/databases/utils.nix deleted file mode 100644 index 47988fc..0000000 --- a/modules/private/databases/utils.nix +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | { pkgs }: | ||
2 | { | ||
3 | keepLastNDumps = ext: backupDir: n: '' | ||
4 | #!${pkgs.stdenv.shell} | ||
5 | |||
6 | cd ${backupDir} | ||
7 | ${pkgs.coreutils}/bin/rm -f \ | ||
8 | $(${pkgs.coreutils}/bin/ls -1 *.${ext} \ | ||
9 | | ${pkgs.coreutils}/bin/sort -r \ | ||
10 | | ${pkgs.gnused}/bin/sed -e '1,${builtins.toString n}d') | ||
11 | ''; | ||
12 | exponentialDumps = ext: backupDir: let | ||
13 | log2rotateSrc = builtins.fetchGit { | ||
14 | url = "https://github.com/avian2/pylog2rotate"; | ||
15 | ref = "master"; | ||
16 | rev = "061f0564757289d3bea553b16f8fd5c4a0319c5e"; | ||
17 | }; | ||
18 | log2rotate = pkgs.writeScript "log2rotate" '' | ||
19 | #!${pkgs.python3}/bin/python | ||
20 | |||
21 | ${builtins.readFile "${log2rotateSrc}/log2rotate.py"} | ||
22 | ''; | ||
23 | in '' | ||
24 | #!${pkgs.stdenv.shell} | ||
25 | |||
26 | cd ${backupDir} | ||
27 | ${pkgs.coreutils}/bin/rm -f $(ls -1 *.${ext} | grep -v 'T22:' | sort -r | sed -e '1,12d') | ||
28 | ${pkgs.coreutils}/bin/rm -f $(ls -1 *T22*.${ext} | ${log2rotate} --skip 7 --fuzz 7 --delete --format='%Y-%m-%dT%H:%M+00:00.${ext}') | ||
29 | ''; | ||
30 | } | ||