Quote:
Originally Posted by tshikose
Hi,
So, you should have a shell script called backup.sh with content similar to the below.
#!/bin/sh
su - postgres -c "rm -rf /var/lib/pgsql/9.4/data/*"
su - postgres -c "pg_basebackup -h 192.XX.XX.XX -U postgres -D /var/lib/pgsql/9.4/data -X stream -P"
su - postgres -c "rm /var/lib/pgsql/tmp/PGSQL.lock"
pcs resource cleanup msPostgresql
Then have backup.sh called in a root cron job.
Please test it thoroughly, and modify it accordingly, before putting in production.
|
U saved the day for me sir, its working perfectly
Now, how do i use a cron job for this...will it be executed on every reboot or is there a custom way out for it??
Regards