Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
apisub
Commits
8eead193
Commit
8eead193
authored
Dec 03, 2019
by
Stephane Crozat
Browse files
Correcting path
parent
850610eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
INSTALL
View file @
8eead193
...
...
@@ -8,20 +8,20 @@ sudo su postgres
sh/apisub_init.sh password
## Create apisub user for backup
user
add -m
apisub
add
user 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
...
...
sh/apisub_backup.sh
View file @
8eead193
#!/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
"
...
...
sh/apisub_ssh.sh
View file @
8eead193
#!/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment