Skip to content

Instantly share code, notes, and snippets.

@alimli
alimli / jira-backup.sh
Created October 25, 2018 14:45
Backup Jira Attachments and PostgreSQL database, keep n latest and delete older
#!/bin/bash
CONFIG_FILE='/etc/jira-backup.conf'
TIMESTAMP=$(date +'%Y-%m-%d-%H-%M')
if [ -e ${CONFIG_FILE} ]; then
source ${CONFIG_FILE}
else
echo "Error: ${CONFIG_FILE} missing"
exit 1
@alimli
alimli / pgdb-backup.sh
Last active October 25, 2018 14:44
Backup PostgreSQL Database, keep Latest N Days and deletes older
#!/bin/bash
if [ -z "$1" ]; then
echo "No argument supplied"
exit 1
fi
DB=$1
CONFIG_FILE="/etc/${DB}-backup.conf"