From 5a439a90cd1cf4d85081b253e4ad2dada7558b79 Mon Sep 17 00:00:00 2001 From: "Sean M. Pappalardo" Date: Fri, 11 May 2018 10:59:22 -0700 Subject: [PATCH 1/3] Wiki archive: exclude unneeded directories - use bzip2 - preserve permissions --- fabfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fabfile.py b/fabfile.py index b5a72add308c..a99883620c1f 100644 --- a/fabfile.py +++ b/fabfile.py @@ -111,8 +111,8 @@ def snapshot(snapshot_name=None): FORUMS_DATABASE_NAME, mysql_snapshot)) wiki_path = os.path.join(instance_path, 'wiki') - wiki_snapshot = 'wiki.tar.gz' - sudo('tar czf {} -C {} .'.format(wiki_snapshot, wiki_path)) + wiki_snapshot = 'wiki.tar.bz2' + sudo('tar --exclude='data/cache' --exclude='data/index' --exclude='data/locks' --exclude='data/tmp' -cjpf {} -C {} .'.format(wiki_snapshot, wiki_path)) # Record snapshot name for chaining commands. env.snapshot_name = snapshot_name From 476bbbb5cc89191337f8a4c91aacb7ae42011ac6 Mon Sep 17 00:00:00 2001 From: "Sean M. Pappalardo" Date: Fri, 11 May 2018 11:01:24 -0700 Subject: [PATCH 2/3] Add reference to wiki backup exclusions --- fabfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fabfile.py b/fabfile.py index a99883620c1f..0f75fe5b185f 100644 --- a/fabfile.py +++ b/fabfile.py @@ -112,6 +112,7 @@ def snapshot(snapshot_name=None): wiki_path = os.path.join(instance_path, 'wiki') wiki_snapshot = 'wiki.tar.bz2' + # Exclusions to save space & time per https://www.dokuwiki.org/faq:backup sudo('tar --exclude='data/cache' --exclude='data/index' --exclude='data/locks' --exclude='data/tmp' -cjpf {} -C {} .'.format(wiki_snapshot, wiki_path)) # Record snapshot name for chaining commands. From 22dc1349ab2ed88cc185a3653f8d9b8fc8861fbe Mon Sep 17 00:00:00 2001 From: "Sean M. Pappalardo" Date: Fri, 11 May 2018 13:15:53 -0700 Subject: [PATCH 3/3] Escape quotes --- fabfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabfile.py b/fabfile.py index 0f75fe5b185f..7929d636ce61 100644 --- a/fabfile.py +++ b/fabfile.py @@ -113,7 +113,7 @@ def snapshot(snapshot_name=None): wiki_path = os.path.join(instance_path, 'wiki') wiki_snapshot = 'wiki.tar.bz2' # Exclusions to save space & time per https://www.dokuwiki.org/faq:backup - sudo('tar --exclude='data/cache' --exclude='data/index' --exclude='data/locks' --exclude='data/tmp' -cjpf {} -C {} .'.format(wiki_snapshot, wiki_path)) + sudo('tar --exclude=\'data/cache\' --exclude=\'data/index\' --exclude=\'data/locks\' --exclude=\'data/tmp\' -cjpf {} -C {} .'.format(wiki_snapshot, wiki_path)) # Record snapshot name for chaining commands. env.snapshot_name = snapshot_name