Create .torrents file from .xz and .sig
Cette révision appartient à :
Parent
7456fc8a03
révision
dff098da6a
4 fichiers modifiés avec 22 ajouts et 2 suppressions
|
@ -7,6 +7,7 @@ NYAAPANTSU_USERNAME="$1"
|
|||
NYAAPANTSU_PASSWORD="$2"
|
||||
NYAAPANTSU_DB="$3"
|
||||
NYAAPANTSU_PASSPHRASE_FILE="$4"
|
||||
NYAAPANTSU_TRACKER="$5"
|
||||
|
||||
dump_file="${NYAAPANTSU_DB}_$(date +'%Y_%m_%d_%H_%M').backup"
|
||||
|
||||
|
@ -15,7 +16,10 @@ pg_dump -U "${NYAAPANTSU_USERNAME}" -f "${dump_file}"
|
|||
xz -z "${dump_file}"
|
||||
|
||||
compressed_dump_file="${dump_file}.xz"
|
||||
signature_file="${compressed_dump_file}.sig"
|
||||
|
||||
gpg2 --batch --yes --passphrase-fd 0 \
|
||||
--output "${compressed_dump_file}.sig" \
|
||||
--output "${signature_file}" \
|
||||
--detach-sig "${compressed_dump_file}" < "${NYAAPANTSU_PASSPHRASE_FILE}"
|
||||
|
||||
mktorrent -a "${NYAAPANTSU_TRACKER}" "${compressed_dump_file}" "${signature_file}"
|
||||
|
|
|
@ -25,3 +25,18 @@
|
|||
dest: "{{ backup_cron_job }}"
|
||||
become: true
|
||||
when: pass_file.stat.exists == true
|
||||
|
||||
- name: Add epel repository
|
||||
yum_repository:
|
||||
name: epel
|
||||
description: EPEL YUM repo
|
||||
baseurl: https://download.fedoraproject.org/pub/epel/$releasever/$basearch/
|
||||
gpgcheck: 1
|
||||
gpgkey: https://getfedora.org/static/352C64E5.txt
|
||||
become: true
|
||||
|
||||
- name: Install mktorrent
|
||||
yum:
|
||||
name: mktorrent
|
||||
state: present
|
||||
become: true
|
||||
|
|
|
@ -1 +1 @@
|
|||
0 {{ backup_cron_hours }} * * * {{ backup_script }} {{ nyaapantsu_user }} {{ nyaapantsu_password }} {{ nyaapantsu_dbname }} {{ nyaapantsu_gpg_passphrase_file }}
|
||||
0 {{ backup_cron_hours }} * * * {{ backup_script }} {{ nyaapantsu_user }} {{ nyaapantsu_password }} {{ nyaapantsu_dbname }} {{ nyaapantsu_gpg_passphrase_file }} {{ torrent_tracker }}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
backup_script: /usr/bin/nyaapantsu_backup.sh
|
||||
backup_cron_hours: 0
|
||||
backup_cron_job: /etc/cron.d/nyaapantsu_backup
|
||||
torrent_tracker: udp://tracker.doko.moe:6969
|
||||
|
|
Référencer dans un nouveau ticket