mirror of
https://github.com/YunoHost/doc.git
synced 2024-09-03 20:06:26 +02:00
7a01793062
* Revert "Revert "markdown format"" * fix formating * fix readme * add .markdownlint.json * add markdownlint-rules-grav-pages * add markdownlint-rules-grav-pages files * add license for Markdown Lint Rules for Grav Pages * fix [figure] mess * fix [figure] mess 2 * fix [figure] mess 3 * maj .gitignore * various fixes * fix markdownlint-rules-grav-pages * second formater pass * various manual fixes * add .markdownlintignore * markdownlintignore: auto-generated pages * disable proper-names for html_elements * another bunch of various markdown fixes * Update pages/02.administer/10.install/20.dns_config/dns_config.es.md Co-authored-by: tituspijean <titus+yunohost@pijean.ovh> --------- Co-authored-by: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Co-authored-by: tituspijean <titus+yunohost@pijean.ovh>
1.3 KiB
1.3 KiB
title | template | taxonomy | routes | page-toc | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Custom backup methods | docs |
|
|
|
It is possible to create your own backup method and link it to YunoHost's backup file collection system. This can be useful if you want to use your own backup software or conduct disk mount/dismount operations for example.
This operation is done with a hook and will allow you to launch a backup this way:
yunohost backup create --method custom
Below is a simplistic example that can be used to set up a rotational backup with different disks that are changed every week:
/etc/yunohost/hooks.d/backup_method/05-custom
#!/bin/bash
set -euo pipefail
work_dir="$2"
name="$3"
repo="$4"
size="$5"
description="$6"
case "$1" in
need_mount)
# Set false if your method can itself put files in good place in your archive
true
;;
backup)
mount /dev/sda1 /mnt/hdd
if [[ "$(df /mnt/hdd | tail -n1 | cut -d" " -f1)" != "/dev/sda1" ]]
then
exit 1
fi
pushd "$work_dir"
current_date=$(date +"%Y-%m-%d_%H:%M")
cp -a "${work_dir}" "/mnt/hdd/${current_date}_$name"
popd
umount /mnt/hdd
;;
*)
echo "hook called with unknown argument \`$1'" >&2
exit 1
;;
esac
exit 0