Scheduled server backup

  • Asked
  • Active
  • Viewed 1492 times
0

Hi,

Fieldteams will be sending data from Collect mobile program to the Open Foris Collect server at the office.

I like to make a scheduled backup on the office server. Can I script backup/export of data from Open Foris Collect server or should I go with a PostgreSQL database and script the database backup?

Regards /Mikael

0

Accepted answer

Dear Mikael,
It would be better and faster to schedule backups of the PostgreSQL database.
You should create a user on the DB that has only read rights on the collect schema, run pg_dump in a cron task to take scheduled backups (if you are running Collect on a Linux machine).
You could write something like this in the crontab to take daily backups:

0 0 * * * pg_dump -U db_user_name collect > /bck/collect/collect_$(date +\%Y\%m\%d\%H\%M\%S).dump

(Replace db_user_name with the name of the user with read rights on the collect DB).
In this example, every day at midnight a dump of the database will be generated.
Also, don't forget that the uploaded pictures are stored by Collect in a folder of the file system (in Linux they will be under ~/OpenForis/Collect/data/collect_upload/, so take care of backing up even them.

I hope it could be useful, let us know, many thanks.
Open Foris Team

Your answer

Markdown text. Shortcuts: Ctrl+B bold, Ctrl+I italic, Ctrl+K link, Ctrl+E code, Ctrl+Shift+V paste as plain text. Tab indents list items and code; press Escape, then Tab, to leave the text box.

Insert an image

Say what the image shows, for people who can't see it.

Keyboard shortcuts

Anywhere

?
Show this list
/
Search
g h
Go to the home page
g q
Go to the questions
g t
Go to the tags
g u
Go to the users
a
Ask a question

Lists of questions

j k
Next or previous question
Enter
Open the question

Question pages

j k
Next or previous post

Shortcuts never apply while you type in a text field. Members can turn them off in their preferences.