Skip to main content


This service allows you to backup the triples in a given dataset, as well as the uploaded files.


  • Backup Fuseki datasets and uploaded files
  • Choose copy method: Rsync, FTP or filesystem (copy to another directory)
  • Setup a cron to automatically launch the rsync operation



$ yarn add @semapps/backup

If you wish to use the Rsync method, you will need to have rsync, sshpass and openssh installed on your server.

$ sudo apt-get install rsync sshpass openssh

You will also need to add the remote server domain as a known host, otherwise sshpass may fail:

ssh-keyscan REMOTE_SERVER_DOMAIN_NAME >> ~/.ssh/known_hosts


const BackupService = require('@semapps/backup');
const path = require('path');

module.exports = {
mixins: [BackupService],
settings: {
localServer: {
fusekiBackupsPath: '/absolute/path/to/fuseki/backups',
otherDirsPaths: {
uploads: path.resolve(__dirname, '../uploads')
copyMethod: 'rsync', // Or 'ftp' or 'fs'
remoteServer: {
path: '/my-backups', // Required
user: 'user', // Required for rsync and ftp
password: 'password', // Required for rsync and ftp
host: '', // Required for rsync and ftp
port: null, // Required for ftp

// Required only if you want to do automatic backups
cronJob: {
time: '0 0 4 * * *', // Every night at 4am
timeZone: 'Europe/Paris'

Service settings

localServer[Object]Absolute path to the Fuseki backups and other directories you want to backup
copyMethod[String]"rsync"Copy method ("rsync", "ftp" or "fs")
remoteServer[Object]Information to connect to the remote server (see above)
cronJob[Object]Information for the automatic backups (see above)


The following service actions are available:


Calls backupDatasets and backupOtherDirs.


Generate a compressed backup of all the existing datasets (through Fuseki protocol), and rsync them with the remote server.


Copy the other directories defined in the settings with the remote server.


Copy the data in the local server to the remote server.

pathStringrequiredAbsolute path to be synchronized with the remote server
subDirStringSub-directory in the remote server