<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://alexandria.anarchaserver.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=M4ra</id>
	<title>Anarchaserver - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://alexandria.anarchaserver.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=M4ra"/>
	<link rel="alternate" type="text/html" href="https://alexandria.anarchaserver.org/index.php/Special:Contributions/M4ra"/>
	<updated>2026-04-25T11:16:06Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://alexandria.anarchaserver.org/index.php?title=Anarcha_section&amp;diff=1484</id>
		<title>Anarcha section</title>
		<link rel="alternate" type="text/html" href="https://alexandria.anarchaserver.org/index.php?title=Anarcha_section&amp;diff=1484"/>
		<updated>2023-03-15T17:14:27Z</updated>

		<summary type="html">&lt;p&gt;M4ra: /* Get involved */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you are interested in Anarchaserver architecture, hosting services &amp;amp; data, future plans, and how to get involved read the following page. &lt;br /&gt;
&lt;br /&gt;
-------------&lt;br /&gt;
== About Us ==&lt;br /&gt;
&lt;br /&gt;
=== ENG ===&lt;br /&gt;
AnarchaServer is a feminist server which contributes to the maintenance of autonomous infrastructure on the Internet for feminists projects. &lt;br /&gt;
&lt;br /&gt;
It is an open project, even though moderated where we privilege trust, consensus, autonomy and feminist collaboration for deciding our next adventures in inhabiting this feminist infrastructure, in synchronicity with other feminist servers initiatives. &lt;br /&gt;
&lt;br /&gt;
AnarchaServer has some kind of presence in different locations around the world such as calafou, belgium, france, germany, greece, iceland, the netherlands,  mexico, sweeden, uruguay ...&lt;br /&gt;
&lt;br /&gt;
Our politics are transfeminists, anticapitalist, decolonialist and aim at creating interspecies solidarity with other bodies, nature and machines. Our group of sysadmin is currently composed by different non-binaries, cis women and one cis men. We use English and Spanish (even-tough those are not always our first languages) for our internal communications. &lt;br /&gt;
&lt;br /&gt;
AnarchaServer can provide to other feminists the following infrastructure: Blogs in the wordpress farm, Encrypted files sending, Encrypted pastebin, Standard polls and events scheduling, Online surveys, Archiving online a feminist website that will close soon, Uploading pictures and videos about cyberfeminism in our repository of collective memories.... &lt;br /&gt;
&lt;br /&gt;
If you are interested in any of these options, please contact us at anarchaserver@autistiche.org and we will see what we can do. Please take into account that we can not always answer. To coordinate among ourselves, we privilege the no pressure policy for advancing tasks that are freely chosen based on the energy, dreams and availability of  AnarchaServer inhabitants.&lt;br /&gt;
&lt;br /&gt;
=== CAST ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AnarchaServer es un servidor feminista que contribuye al mantenimiento de una infraestructura autónoma en Internet para proyectos feministas.&lt;br /&gt;
&lt;br /&gt;
Es un proyecto abierto, aunque moderado, en el que privilegiamos la confianza, el consenso, la autonomía y la colaboración para decidir nuestras próximas aventuras al habitar esta infraestructura feminista, en sincronía con otras iniciativas de servidores feministas.&lt;br /&gt;
&lt;br /&gt;
AnarchaServer tiene algún tipo de presencia en diferentes lugares del mundo como calafou, bélgica, francia, alemania, grecia, holanda, islandia, méxico, suecia, uruguay...&lt;br /&gt;
&lt;br /&gt;
Nuestra política es transfeminista, anticapitalista, descolonialista y tiene como objetivo crear solidaridades interespecie con otros cuerpos, ecosistemas y máquinas. Nuestro grupo de sysadmin está actualmente compuesto por diferentes personas, mujeres cis, no binarixs y un hombre cis. Usamos el inglés y el español (aunque no siempre son nuestros primeros idiomas) para nuestras comunicaciones internas.&lt;br /&gt;
&lt;br /&gt;
AnarchaServer puede proporcionar a otras feministas la siguiente infraestructura: Blogs en su granja de wordpress, Envío de archivos cifrados, Pastebin cifrados, Encuestas estándar y sondeo de fechas, Cuestionarios online, Archivo online de paginas webs feministas, Repositorio audiovisual ciberfeminista de memorias colectivas....&lt;br /&gt;
&lt;br /&gt;
Si te interesa alguna de estas opciones, ponte en contacto con nosotras en anarchaserver@autistiche.org y veremos qué podemos hacer. Ten en cuenta que no siempre podemos responder. Para coordinarnos entre nosotras, privilegiamos una política de no presión para avanzar en las tareas que se eligen libremente en base a la energía, los sueños y la disponibilidad de las habitantes de AnarchaServer.&lt;br /&gt;
&lt;br /&gt;
== Anarchaserver architecture ==&lt;br /&gt;
&lt;br /&gt;
=== Living data container ===&lt;br /&gt;
&lt;br /&gt;
We talk about living data when data are available online, get updates, posts and are actively contributed to . We range under living data the contents of this [https://alexandria.anarchaserver.org mediawiki] and the [https://zoiahorn.anarchaserver.org/ WordPress farm Zoia Horn]. &lt;br /&gt;
&lt;br /&gt;
=====  Alexandria ===== &lt;br /&gt;
&lt;br /&gt;
This is [https://alexandria.anarchaserver.org/ our wiki] that you are reading at the moment. Here we provide space for documenting our work setting up and inhabiting AS and how to engage and get involved and for [[Main_Page#Anarchaserver|documenting feminist infrastructure]] herstory, initiatives and events such as the TransHackFeminist Convergences. &lt;br /&gt;
&lt;br /&gt;
===== Zoia Horn =====&lt;br /&gt;
&lt;br /&gt;
This is a feminist multisite blogging platform based on Wordpress. At the moment we are beta-testing different blogs and use cases. We hope to be able in the future to provide wordpress to feminists collectives that require one for documenting and communicating about what they do. Check it out: &lt;br /&gt;
&lt;br /&gt;
[http://zoiahorn.anarchaserver.org/ Zoiahorn blog] for documenting anarcha physical interface and new blogs inhabited in this container.&lt;br /&gt;
&lt;br /&gt;
[https://zoiahorn.anarchaserver.org/specfic/ Feminist futurotopias workshops]&lt;br /&gt;
&lt;br /&gt;
[https://zoiahorn.anarchaserver.org/misexualidad/ Mi sexualidad es una creación artística]&lt;br /&gt;
&lt;br /&gt;
[https://zoiahorn.anarchaserver.org/holobionte/ Holobionte]&lt;br /&gt;
&lt;br /&gt;
=== Transitional data container === &lt;br /&gt;
&lt;br /&gt;
We talk about transitional data when data needs to remain available only for a while and then should be erased properly. We have set up specific services such as:&lt;br /&gt;
* Encrypted files sending (Jirafeau https://transitional.anarchaserver.org/jirafeau/)&lt;br /&gt;
* Encrypted pastebin where the server has zero knowledge of pasted data. (Zerobin https://transitional.anarchaserver.org/zerobin/). Data is encrypted/decrypted in the browser using 256 bits AES.&lt;br /&gt;
* Standard polls and events scheduling (Open Sondage https://transitional.anarchaserver.org/date/)&lt;br /&gt;
* Online surveys (LimeSurvey https://transitional.anarchaserver.org/poll/). Only available to inhabitants.&lt;br /&gt;
* Next Cloud (Upload documents, pictures, decks, surveys https://transitional.anarchaserver.org/cloud/apps/forms/). Only available to inhabitants.&lt;br /&gt;
&lt;br /&gt;
=== Nekrocemetery container === &lt;br /&gt;
&lt;br /&gt;
We talk about dead data when data has gone offline and it needs to be archived in a way that it remains possible to bring it back to life again.  Our nekrocemetery is oriented at feminist websites and projects that are offline and could become zombie data. More on the [https://alexandria.anarchaserver.org/index.php/Nekrocemetery:_Hello_from_the_dead Nekrocemetery:_Hello_from_the_dead ].&lt;br /&gt;
&lt;br /&gt;
[https://zoiahorn.anarchaserver.org/thf2022/2022/04/20/agenda-hello-from-the-dead-anarchaserver-feminist-kekrocementery-archive/ Documentation about the node held about the Anarchaserver Nekrocemetery during the THF2022]&lt;br /&gt;
&lt;br /&gt;
List of archived websites:&lt;br /&gt;
* Static backup of [https://gendersec.anarchaserver.org/ Gendersec wiki]&lt;br /&gt;
* Static backup of [https://nekrocemetery.anarchaserver.org/mlff/ mlff wesbite]&lt;br /&gt;
* Static backup of [https://geekfeminism.anarchaserver.org/ Geek Feminism Wiki]&lt;br /&gt;
* Static backup of [https://nekrocemetery.anarchaserver.org/redefeminista.org/ Redes Autonomas e Feministas]&lt;br /&gt;
* Static backup of TransHackFeminist 2022 website&lt;br /&gt;
&lt;br /&gt;
=== Repository container ===&lt;br /&gt;
&lt;br /&gt;
Collective memories, a [https://repository.anarchaserver.org/ cyberfeminist repository] for archiving images, sounds and videos set up with piwigo [[Repository|Container repository]].&lt;br /&gt;
&lt;br /&gt;
=== Sonification ===&lt;br /&gt;
&lt;br /&gt;
If you want to listen to AnarchaServer please [http://anarchaserver.org:8000/ connect here and you will ear a sonification of the server]. We have a icecast2 streaming tool installed in AS.&lt;br /&gt;
&lt;br /&gt;
=== More information === &lt;br /&gt;
&lt;br /&gt;
* Anarcha host : Apache2 : landing page and vhosts to proxy to the containers&lt;br /&gt;
** Container livingdata : Apache2 vhosts for the wiki and the wordpress farm&lt;br /&gt;
*** https://alexandria.anarchaserver.org : Mediawiki&lt;br /&gt;
*** https://zoiahorn.anarchaserver.org/ : Wordpress Farm&lt;br /&gt;
** Container repository : Apache2 vhost for the repository&lt;br /&gt;
*** https://repository.anarchaserver.org/ : piwigo (upload images, sounds and vidéos)&lt;br /&gt;
** Container transitional : nginx with Yunohost&lt;br /&gt;
*** https://transitional.anarchaserver.org/yunohost/sso/ : Access to the services (jirafeau, opensondage, zerobin, limesurvey, mytinytodo)&lt;br /&gt;
*** https://transitional.anarchaserver.org/yunohost/admin/#/ : Admin yunohost (create users, install applications, make backups)&lt;br /&gt;
** Container nekrocemetery : Apache2 vhosts for each website&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[File:BlackquantumFuturism.gif|thumb]]&lt;br /&gt;
&lt;br /&gt;
==  Future is now: Milestones == &lt;br /&gt;
&lt;br /&gt;
=== Old Roadmap ===  &lt;br /&gt;
&lt;br /&gt;
[[Roadmap To do List 2019]]. &lt;br /&gt;
&lt;br /&gt;
[[Roadmap To do List 2020]]&lt;br /&gt;
&lt;br /&gt;
=== Current ===  &lt;br /&gt;
&lt;br /&gt;
From October 2020, we list to do tasks and issues in Anarchaserver project in [https://git.systerserver.net/groups/anarchaserver/-/issues the gitlab of systerserver].&lt;br /&gt;
&lt;br /&gt;
===== Maintenance &amp;amp; Infrastructure =====&lt;br /&gt;
&lt;br /&gt;
* How to [[be a guardian, a fire extinguisher, a scriba, an interface]]&lt;br /&gt;
&lt;br /&gt;
===== Accessing =====&lt;br /&gt;
&lt;br /&gt;
* How to [[access server]]&lt;br /&gt;
* How to use [[screen]]&lt;br /&gt;
* How to access [[database]]&lt;br /&gt;
&lt;br /&gt;
===== Installing/Testing hardware +distribution =====&lt;br /&gt;
&lt;br /&gt;
2020:&lt;br /&gt;
[[Moving to new machine binti]]&lt;br /&gt;
&lt;br /&gt;
2019 and before: &lt;br /&gt;
[[machine]]&lt;br /&gt;
&lt;br /&gt;
HowTos:&lt;br /&gt;
* [[backup]] system&lt;br /&gt;
* [[Upgrade]] debian&lt;br /&gt;
* Old: Server [[security]] for Anoia&lt;br /&gt;
* [[Check list security for feminist servers]]&lt;br /&gt;
* [https://netdata.anarchaserver.org Netdata] for monitoring the different containers of the VM &lt;br /&gt;
* Install [[https certbot]] with let's encrypt initiative&lt;br /&gt;
* [[Moving_to_new_machine_binti#Serveur_Sonification|Streaming + Sonification]]&lt;br /&gt;
&lt;br /&gt;
===== Virtualisation =====&lt;br /&gt;
&lt;br /&gt;
How to set up a LXC container to host others web applications with Linux [[Containers]] (LXC) &lt;br /&gt;
&lt;br /&gt;
* '''Living data''' &amp;gt; blogging platform &amp;amp; documentation, &lt;br /&gt;
** MediaWiki : [[Updating]] sites Mediawiki 1.25 &amp;gt; 1.32 and How to reset passwords for [[mediawiki]]&lt;br /&gt;
** [[WordPress Multisites]] a farm of blogs : installation, configuration and utilisation&lt;br /&gt;
* '''Transitional''' &amp;gt; [[In transition]] encrypted data transfer, survey's,..., Yunohost installation &amp;gt;&amp;gt; [[How to use yunohost]]&lt;br /&gt;
* '''Nekrocemetery''' &amp;gt; [[Nekrocemetery]] and zombie sites&lt;br /&gt;
* '''Repository''' &amp;gt; [[Repository]] Image,  sound, video - a media repository: Piwigo&lt;br /&gt;
&lt;br /&gt;
===== Narratives ===== &lt;br /&gt;
&lt;br /&gt;
* Logo, images, video design about Anarchaserver&lt;br /&gt;
* Ckeck List pages for Las Guardianas/Custodians + Apagafuegos/Fire Extinguishers + Escribas + Interfaces&lt;br /&gt;
* Prepare [[Terms of Use and Feminist Science Fiction Narrative]]&lt;br /&gt;
* Prepare [[Project:Privacy_policy]]&lt;br /&gt;
* [[AS SF Narratives]]&lt;br /&gt;
&lt;br /&gt;
[[File:Computer-criminal.jpg|center]]&lt;br /&gt;
WRITE READ EXECUTE&lt;br /&gt;
&lt;br /&gt;
== Get involved == &lt;br /&gt;
&lt;br /&gt;
Anarchaserver is an open project, even though moderated where we privilege trust, consensus, autonomy and feminist collaboration for deciding our next adventures in inhabiting AS, in synchronicity with other feminist servers initiatives.&lt;br /&gt;
&lt;br /&gt;
Our politics are transfeminists, anticapitalist, decolonialist and aim at creating interspecies solidarity with other bodies, nature and machines. Our group of sysadmin is currently composed by different non-binaries, cis women and one cis man. We use English and Spanish (even-though those are not our first languages) for our internal communications and we intend to build inclusive spaces so that sysadmins from around the world can join Anarchaserver.&lt;br /&gt;
&lt;br /&gt;
To coordinate among ourselves, we privilege the no pressure policy for advancing tasks that are freely chosen based on the energy, dreams and availability of AS inhabitants. We are using different means and tools to coordinate and advance the different tasks among ourselves. If you want to get involved, check out our current [[Channels of communication]].&lt;/div&gt;</summary>
		<author><name>M4ra</name></author>
	</entry>
	<entry>
		<id>https://alexandria.anarchaserver.org/index.php?title=Backup&amp;diff=1122</id>
		<title>Backup</title>
		<link rel="alternate" type="text/html" href="https://alexandria.anarchaserver.org/index.php?title=Backup&amp;diff=1122"/>
		<updated>2021-10-01T11:31:42Z</updated>

		<summary type="html">&lt;p&gt;M4ra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Workshop =&lt;br /&gt;
&lt;br /&gt;
In this workshop, we will create a bash script to run as a cron job for our system backups. We have installed and run restic for one-off backups and we would like to schedule them on a daily basis. The backup takes place between anarchaserver and a remote server, which is the backup repository. But it can be also applied between our PC and a raspberry-pi or any home based file server. &lt;br /&gt;
&lt;br /&gt;
Meeting Sunday 04 April 2021 - 3PM CET Time here: https://bbb.futuretic.fr/b/spi-utv-eo9-lqe&lt;br /&gt;
&lt;br /&gt;
En este taller, vamos a crear un script bash para ejecutar como un trabajo cron para nuestras copias de seguridad del sistema. Hemos instalado y ejecutado restic para copias de seguridad puntuales y nos gustaría programarlas diariamente. La copia de seguridad tiene lugar entre anarchaserver y un servidor remoto, que es el repositorio de la copia de seguridad. Pero también se puede aplicar entre nuestro PC y una raspberry-pi o un servidor de archivos casero. &lt;br /&gt;
&lt;br /&gt;
Cita el Domingo 04 de Abril - 3PM CET time aqui: https://bbb.futuretic.fr/b/spi-utv-eo9-lqe&lt;br /&gt;
&lt;br /&gt;
= Current setup =&lt;br /&gt;
Now the backup of Binti is done with a script that relies on Restic tool&lt;br /&gt;
&lt;br /&gt;
We used to do backups with duplicity but we opted for restic as it is easier to install than duplicity. However duplicity has more options on how to fine tune backups.&lt;br /&gt;
&lt;br /&gt;
Simplest tool for backups is rsync (https://rsync.samba.org/) which copies files, which can be archived or not, and checks if a file has been modified, or is removed or created and updates the backup target repo accordingly. But it doesn't create snapshots and thus we cannot access the state of a system's files of a specific date in the past. Dedicated backup tools create snapshots and retain a history of the changes, so we can choose what version to restore. However we need to be aware of the backup's size storage and remove older snapshots.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps we follow to backup AS LXC containers ==&lt;br /&gt;
Note: all system paths and parameters in this HOWTO are fictional.&lt;br /&gt;
&lt;br /&gt;
=== Process ===&lt;br /&gt;
* stop the containers (because AS containers were created and managed by root user, they need root privlege to stop them. We solved this by allowing the specific lxc stop/start commands for the backup user via the sudoers.d configuration.)&lt;br /&gt;
* backup the containers&lt;br /&gt;
* restart the containers&lt;br /&gt;
&lt;br /&gt;
=== System setup ===&lt;br /&gt;
* a backup 'user' &lt;br /&gt;
* ssh keys to access remote backup repo&lt;br /&gt;
* password for restic backup command&lt;br /&gt;
* bash script with the necessary commands to run the process above&lt;br /&gt;
* cron job added via the backup user to run the bash script on regular intervals&lt;br /&gt;
&lt;br /&gt;
=== Configuration of the system setup ===&lt;br /&gt;
==== 1. How to access the remote backup repo? ====&lt;br /&gt;
* create new ssh keys for ssh access to the remote backup repo, and give directory flag for saving the keys under the desired directory.&lt;br /&gt;
* scp the new pub key in the remote backup repo, under the remote user's home .ssh/authorized_keys. Remote user is the one we use to ssh to the remote machine.&lt;br /&gt;
&lt;br /&gt;
==== 2. How to run the backup command without root privelege ==== &lt;br /&gt;
when some of the filesystem to be backed-up is accessed only by root, aka execute a binary meant for root without being root? The idea is to execute the restic binary from backup user's home or from /usr/bin.&lt;br /&gt;
&lt;br /&gt;
creates the new user and a group with the same name&lt;br /&gt;
 useradd backupuser&lt;br /&gt;
makes user root and group backupuser owners of the restic binary&lt;br /&gt;
 chown root:backupuser /usr/bin/restic&lt;br /&gt;
user root has now read, write, execute permissions, and users in backupuser group can execute and read the restic binary&lt;br /&gt;
 chmod 750 /usr/bin/restic&lt;br /&gt;
assigns capabilities to backup the whole system&lt;br /&gt;
 setcap cap_dac_read_search=+ep ~backupuser/bin/restic &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ref: https://restic.readthedocs.io/en/stable/080_examples.html#backing-up-your-system-without-running-restic-as-root&lt;br /&gt;
&lt;br /&gt;
==== 3. How to run specific root commands by a non root user? ====&lt;br /&gt;
Note: we needed that for stopping, checking status and starting of the lxc containers&lt;br /&gt;
We should run our LXC containers rootless. This requires to change configuration of containers, lxc config files (to be checked/implemented in the future, tasks to do for AS, to be added in tasks in gitlab; Mika can you create a git issue for this too?)&lt;br /&gt;
&lt;br /&gt;
Ref: https://www.cyberciti.biz/faq/how-to-create-unprivileged-linux-containers-on-ubuntu-linux/&lt;br /&gt;
&lt;br /&gt;
But for now we will give the backupuser restricted root privelege for the specific lxc commands we need to run in the backup script.&lt;br /&gt;
 usermod -aG sudo backupuser&lt;br /&gt;
&lt;br /&gt;
Give the backup user the acces for specific commands to be executed as 'root'.&lt;br /&gt;
Add these commands in a  new file under /etc/sudoers.d/&lt;br /&gt;
 vi /etc/sudoers.d/00-backupuser &lt;br /&gt;
 bintibackup ALL=(ALL) NOPASSWD: /usr/bin/lxc-stop, /usr/bin/lxc-start, /usr/bin/lxc-info, /usr/bin/lxc-ls&lt;br /&gt;
&lt;br /&gt;
Ref:  https://www.cyberciti.biz/faq/linux-unix-running-sudo-command-without-a-password/&lt;br /&gt;
&lt;br /&gt;
++++&lt;br /&gt;
 chown root:bintibackup /usr/bin/lxc-stop &lt;br /&gt;
&amp;gt; this is for changing the property to usr/bin/lxc-stop to root group and bintibackup &lt;br /&gt;
&lt;br /&gt;
first, we are trying to make this happen with a bintibackup user with no root privilege -  if it does no work, will switch to possibility to give the bintibackup user root provileges, but this will imply to have a vert strict security management policy for that userthis&lt;br /&gt;
above scratched steps didn't work!&lt;br /&gt;
++++&lt;br /&gt;
 &lt;br /&gt;
==== One line command to run backups from terminal ====&lt;br /&gt;
Needs the following parameters:&lt;br /&gt;
&lt;br /&gt;
path to password file:&lt;br /&gt;
  PASSWORD=&amp;quot;~backupuser/pass&amp;quot;&lt;br /&gt;
absolute path to the remote backup repo: &lt;br /&gt;
  remote-repo =&amp;quot;/var/backups&amp;quot;&lt;br /&gt;
abosulte path to the directory we want to backup:&lt;br /&gt;
  local-repo=&amp;quot;/var/foo&amp;quot;&lt;br /&gt;
remote host:&lt;br /&gt;
  $host=&amp;quot;backups.org&amp;quot;&lt;br /&gt;
  $user=&amp;quot;backuphost&amp;quot;&lt;br /&gt;
So the command becomes:&lt;br /&gt;
 restic -p ~/backup/pass -r sftp:backuphost@backups.org:/var/backups --verbose backup /var/foo&lt;br /&gt;
OR:&lt;br /&gt;
 restic -p $PASSWORD -r sftp:$user@$host:$remote-path --verbose backup&lt;br /&gt;
&lt;br /&gt;
Final bash script (the exact paths haave been changed to fictional ones)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# a backup to our backup server of the LXC containers&lt;br /&gt;
&lt;br /&gt;
set -e&lt;br /&gt;
PASSWORD=/root/mypassword_enter&lt;br /&gt;
# Destination&lt;br /&gt;
DEST=&amp;quot;sftp:binti-backups:/server/backups&amp;quot;&lt;br /&gt;
STATIC_OPTIONS=&amp;quot;--verbose backup&amp;quot;&lt;br /&gt;
ROOT=&amp;quot;/var/lib/lxc&amp;quot;&lt;br /&gt;
# list containers&lt;br /&gt;
CONTAINERS=&amp;quot;$(sudo lxc-ls)&amp;quot;&lt;br /&gt;
declare -a STOPPED_CONTAINERS&lt;br /&gt;
&lt;br /&gt;
# Check if containers are running and then stop the containers&lt;br /&gt;
echo $containers&lt;br /&gt;
for container in ${CONTAINERS[@]}; do&lt;br /&gt;
    echo $container&lt;br /&gt;
    status=&amp;quot;$(sudo lxc-info $container | grep 'State' | xargs | cut -d' ' -f2)&amp;quot;&lt;br /&gt;
    echo $status&lt;br /&gt;
    if [[ $status == &amp;quot;STOPPED&amp;quot; ]]; then&lt;br /&gt;
        STOPPED_CONTAINERS+=(&amp;quot;$container&amp;quot;)&lt;br /&gt;
    elif [[ $status == &amp;quot;RUNNING&amp;quot; ]]; then&lt;br /&gt;
        sudo lxc-stop $container&lt;br /&gt;
        # Update the list of stopped containers&lt;br /&gt;
        STOPPED_CONTAINERS+=(&amp;quot;$container&amp;quot;)&lt;br /&gt;
    fi&lt;br /&gt;
done&lt;br /&gt;
set +e&lt;br /&gt;
restic -p $PASSWORD -r  $DEST $STATIC_OPTIONS $ROOT&lt;br /&gt;
&lt;br /&gt;
BACKUP_SUCCESS=$?&lt;br /&gt;
set -e&lt;br /&gt;
&lt;br /&gt;
if [[ $BACKUP_SUCCESS -eq 0 ]]; then&lt;br /&gt;
    echo &amp;quot;BACKUP succeeded&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
    # Send email to admins&lt;br /&gt;
    echo &amp;quot;BACKUP failed&amp;quot;&lt;br /&gt;
    sendemail admin@backups.org &amp;lt; ./mail.txt&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
for container in ${STOPPED_CONTAINERS[@]}; do&lt;br /&gt;
        echo $container&lt;br /&gt;
        sudo lxc-start $container&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources for backup scripts and helpful tips ==&lt;br /&gt;
restic for backups&lt;br /&gt;
* https://restic.readthedocs.io/en/stable/040_backup.html&lt;br /&gt;
duplicity&lt;br /&gt;
* https://blog.xmatthias.com/duplicity_backup_script/&lt;br /&gt;
What to backup&lt;br /&gt;
* https://www.debian.org/doc/manuals/debian-reference/ch10.en.html#_backup_and_recovery&lt;br /&gt;
Read password from a file:&lt;br /&gt;
* https://www.foxinfotech.in/2019/03/reading-a-password-from-a-file-in-linux.html&lt;br /&gt;
&lt;br /&gt;
= Old setup = &lt;br /&gt;
&lt;br /&gt;
We currently make a nightly backup of all containers from our virtual machine (called &amp;lt;code&amp;gt;anoia&amp;lt;/code&amp;gt;) to the virtual machine of calafou.org (called &amp;lt;code&amp;gt;ebro&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
We use the backup tool called &amp;lt;code&amp;gt;duplicity&amp;lt;/code&amp;gt; through a package from the Debian repository.&lt;br /&gt;
&lt;br /&gt;
We wrote a script that performs that backup, which is located at &amp;lt;code&amp;gt;/usr/local/bin/backup3.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The backup script runs every night around 4am, because we run it via &amp;lt;code&amp;gt;cron&amp;lt;/code&amp;gt; (configured with &amp;lt;code&amp;gt;sudo crontab -e&amp;lt;/code&amp;gt; command).&lt;br /&gt;
&lt;br /&gt;
In the cron job we redirect the script output to &amp;lt;code&amp;gt;/var/log/backup.log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script stops ALL the containers (to have enough RAM for running &amp;lt;code&amp;gt;duplicity&amp;lt;/code&amp;gt; and to make sure that the databases and other volatile files inside the containers are not changing during the backup), backs up the containers, then starts the containers again.  Obviously, while the containers are stopped and the backup is running, the anarchaserver services are not available.  We have many ideas about how to do a backup without service interruption, but we have not implemented them yet.&lt;br /&gt;
&lt;br /&gt;
There are many possible improvements to this system: &lt;br /&gt;
&lt;br /&gt;
* Change remote: switch from calafou virtual machine to S14&lt;br /&gt;
* Optimise the script: rewrite the script to be a more beautiful program&lt;br /&gt;
* Test backup recovery: try to restore the backup to make sure it is possible&lt;br /&gt;
* Change the backup tool: use &amp;lt;code&amp;gt;borgbackup&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;duplicity&amp;lt;/code&amp;gt;&lt;br /&gt;
* Use a backup manager such as &amp;lt;code&amp;gt;backupninja&amp;lt;/code&amp;gt;&lt;br /&gt;
* Etc.&lt;br /&gt;
&lt;br /&gt;
We also have a S14 for setting up the tunnel for backup and openvpn, [[info about back-tunnel here]].&lt;br /&gt;
&lt;br /&gt;
= Restore a backup =&lt;br /&gt;
 duplicity scp://anoia@ebro.tachanka.org//home/anoia/backup/repository /var/lib/lxc --ssh-options=&amp;quot;-oIdentityFile=/var/backups/.ssh/id_binti&amp;quot; --verbosity 6&lt;br /&gt;
&lt;br /&gt;
= Useful links =&lt;br /&gt;
&lt;br /&gt;
* How to back up a Debian system using backupninja? http://xmodulo.com/backup-debian-system-backupninja.html&lt;br /&gt;
* Using Duplicity to backup LXC containers https://www.savjee.be/2017/05/Using-Duplicity-to-Backup-LXC-Containers/&lt;br /&gt;
* Implement a backup system of livingdata and repository containers (gitlab issue on systerserver) https://git.systerserver.net/collective-anarchaserver/organizing/issues/1&lt;br /&gt;
* Roadmap https://git.systerserver.net/collective-anarchaserver/organizing/issues/1&lt;br /&gt;
&lt;br /&gt;
= Older notes =&lt;br /&gt;
&lt;br /&gt;
STEP 1&lt;br /&gt;
check data usage&lt;br /&gt;
df -h&lt;br /&gt;
&lt;br /&gt;
STEP 2&lt;br /&gt;
check access to another virtual machine&lt;br /&gt;
&lt;br /&gt;
STEP 3&lt;br /&gt;
start screen session in root&lt;br /&gt;
&lt;br /&gt;
STEP 4&lt;br /&gt;
copy data to virtual machine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
rsync -ravz --progress --exclude &amp;quot;/proc&amp;quot; --exclude &amp;quot;/sys&amp;quot; --exclude &amp;quot;/dev&amp;quot; -e &amp;quot;ssh -p 8022&amp;quot; / root@188.210.92.35:/var/backups/vm/anarcha &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
r (recursive)&lt;br /&gt;
a (archive - for special files)&lt;br /&gt;
v (verbose)&lt;br /&gt;
z (compressed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
STEP 5&lt;br /&gt;
diagnostics&lt;br /&gt;
&lt;br /&gt;
watch&lt;br /&gt;
watch -n 180 &amp;quot;du -sh /var/backups/vm/anarcha&amp;quot;&lt;br /&gt;
&lt;br /&gt;
proc/kcore is a special directory which is created each time the computer boots&lt;br /&gt;
so we have to exclude it from the rsync command&lt;br /&gt;
&lt;br /&gt;
bwm-ng&lt;br /&gt;
we want to know whether the data is arriving and at which speed, data amount&lt;br /&gt;
http://linux.die.net/man/1/bwm-ng&lt;br /&gt;
&lt;br /&gt;
apt-get install bwm-ng&lt;/div&gt;</summary>
		<author><name>M4ra</name></author>
	</entry>
</feed>