---
title: "Scheduled server backup"
url: "https://openforis.support/questions/3324/scheduled-server-backup"
tags: ["collect"]
status: "answered"
score: 0
answer_count: 1
asked: "2022-02-21T12:21:46"
last_activity: "2022-02-21T23:09:23"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# Scheduled server backup

Asked by OpenF_mho on 2022-02-21

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


## Answer (score 0, by Stefano (OF) on 2022-02-21)

Link: https://openforis.support/questions/3324/scheduled-server-backup/3325

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
