Commit 8eead193 authored by Stephane Crozat's avatar Stephane Crozat
Browse files

Correcting path

parent 850610eb
......@@ -8,20 +8,20 @@ sudo su postgres
sh/apisub_init.sh password
## Create apisub user for backup
useradd -m apisub
adduser apisub
mkdir /home/apisub/backup
chown apisub:postgres /home/apisub/backup
chmod 770 /home/apisub/backup
## Config SSH for apisub
## Setup backup scripts and cron
cp sh/apisub_backup.sh /usr/bin
chown postgres:postgres /usr/bin/apisub_backup.sh
cp sh/apisub_ssh.sh /usr/bin
chown apisub:apisub /usr/bin/apisub_backup.sh
su apisub
crontab -e
su postgres
crontab -e
crontab -e -u postgres
crontab -e -u apisub
## pgcrypto module
apt install postgresql-contrib
......
#!/bin/bash
# Execute as postgres user
# crontab -e : 0 * * * * /media/stc/data/git/apisub/sql/apisub_backup.sh
# crontab -e : 0 * * * * /usr/bin/apisub_backup.sh
path='/home/apisub/backup'
date=`date -Iminutes`
echo "$date"
......
#!/bin/bash
# Execute as apisub user
# crontab -e : 5 * * * * /media/stc/data/git/apisub/sql/apisub_ssh.sh
src='/home/apisub/backup/'
dest='/home/apisub/backup/'
# crontab -e : 5 * * * * /usr/bin/apisub_ssh.sh
src='/home/apisub/backup/*'
dest='/media/pi/MY3T-STPH/apisub'
user='apisub'
host='bdu.crzt.fr'
echo "rsync $src/* $user@$host:$dest"
echo "rsync $src $user@$host:$dest"
rsync $src/* $user@$host:/$dest
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment