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

Correcting path

parent 850610eb
...@@ -8,20 +8,20 @@ sudo su postgres ...@@ -8,20 +8,20 @@ sudo su postgres
sh/apisub_init.sh password sh/apisub_init.sh password
## Create apisub user for backup ## Create apisub user for backup
useradd -m apisub adduser apisub
mkdir /home/apisub/backup mkdir /home/apisub/backup
chown apisub:postgres /home/apisub/backup chown apisub:postgres /home/apisub/backup
chmod 770 /home/apisub/backup chmod 770 /home/apisub/backup
## Config SSH for apisub
## Setup backup scripts and cron ## Setup backup scripts and cron
cp sh/apisub_backup.sh /usr/bin cp sh/apisub_backup.sh /usr/bin
chown postgres:postgres /usr/bin/apisub_backup.sh chown postgres:postgres /usr/bin/apisub_backup.sh
cp sh/apisub_ssh.sh /usr/bin cp sh/apisub_ssh.sh /usr/bin
chown apisub:apisub /usr/bin/apisub_backup.sh chown apisub:apisub /usr/bin/apisub_backup.sh
su apisub crontab -e -u postgres
crontab -e crontab -e -u apisub
su postgres
crontab -e
## pgcrypto module ## pgcrypto module
apt install postgresql-contrib apt install postgresql-contrib
......
#!/bin/bash #!/bin/bash
# Execute as postgres user # 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' path='/home/apisub/backup'
date=`date -Iminutes` date=`date -Iminutes`
echo "$date" echo "$date"
......
#!/bin/bash #!/bin/bash
# Execute as apisub user # Execute as apisub user
# crontab -e : 5 * * * * /media/stc/data/git/apisub/sql/apisub_ssh.sh # crontab -e : 5 * * * * /usr/bin/apisub_ssh.sh
src='/home/apisub/backup/' src='/home/apisub/backup/*'
dest='/home/apisub/backup/' dest='/media/pi/MY3T-STPH/apisub'
user='apisub' user='apisub'
host='bdu.crzt.fr' host='bdu.crzt.fr'
echo "rsync $src/* $user@$host:$dest" echo "rsync $src $user@$host:$dest"
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