New backup carried out on anarwiki.org by root at local Tue Apr 30 11:08:56 UTC 2024.
This commit is contained in:
parent
bca74b2b9a
commit
a59dbd5ab9
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This backups the mediawiki installation.
|
||||
|
||||
set -e
|
||||
|
||||
mkdir -p assets
|
||||
|
||||
pass=$(grep wgDBpassword ../LocalSettings.php | awk -F'"' '{print $2}')
|
||||
user=$(grep wgDBuser ../LocalSettings.php | awk -F'"' '{print $2}')
|
||||
name=$(grep wgDBname ../LocalSettings.php | awk -F'"' '{print $2}')
|
||||
host=$(grep wgDBserver ../LocalSettings.php | awk -F'"' '{print $2}')
|
||||
|
||||
MYSQL_PWD=$pass mysqldump --no-tablespaces -h $host -u $user $name > assets/database.sql
|
||||
|
||||
php ../maintenance/dumpBackup.php --full > assets/full-dump.xml
|
||||
|
||||
tar zcvfh assets/wikidata.tar.gz --exclude="backupper" ..
|
||||
|
||||
# Also copy the docs
|
||||
cp *.txt *.sh assets/
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
|
||||
cd $SCRIPT_DIR
|
||||
|
||||
nice ./backup-private.sh # && ./git-backup.sh
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# This script copies the contents of a directory to the git master
|
||||
# of a given repository. It thus can abuse Git for revisioned
|
||||
# backups. Sweet!
|
||||
# 2021, Public Domain, SvenK
|
||||
|
||||
backup_directory="assets"
|
||||
git_work_directory="assets-git"
|
||||
|
||||
# these are secrets:
|
||||
user="<YOUR USERNEME. better make a dedicated token at github/gitlab/etc>"
|
||||
pass="<YOUR PASS>"
|
||||
remote="https://$user:$pass@githost/the/path.git"
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf $git_work_directory
|
||||
|
||||
git clone --depth=1 $remote $git_work_directory
|
||||
cp $backup_directory/* $git_work_directory
|
||||
cd $git_work_directory
|
||||
git add .
|
||||
git commit -m"New backup carried out on $(hostname) by $(whoami) at local $(date)."
|
||||
git push
|
||||
cd ..
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue