How can i run "post-backup" script in my config-backup?

Hello everyone. Sorry for the dumb question. But I already search a lot and can’t find the place where I can put a post-backup script to copy my configuration backup to another folder. I need to put this on a samba share, that are being backed up to the cloud by another server.

Can someone, please, help me?

Thanks a lot!

Hi canove,

The configuration backup is stored in: /var/lib/nethserver/backup/

  backup-config.tar.xz
  backup-config.tar.xz-content.md5
  backup-config.tar.xz.md5

You can make a cron job that will copy those file to the samba share, just before the backup to the cloud.

But, the config backup is included in the config data backup. So there is no reason to back it up.

You can try to find it in the data backup: (might take some time…)

  # /sbin/e-smith/backup-data-list -b backup-data | grep backup-config.tar.xz
 
  Sun Jun  2 03:00:21 2019 var/lib/nethserver/backup/backup-config.tar.xz
  Sun Jun  2 03:00:21 2019 var/lib/nethserver/backup/backup-config.tar.xz-content.md5
  Sun Jun  2 03:00:21 2019 var/lib/nethserver/backup/backup-config.tar.xz.md5
  ...

My backup starts at 03h00.

Michel-André

1 Like

Why don’t you directly do the backup to a samba-share?

1 Like

How can I?

Just to be clear, I am talking about the “Configuration Backup”

Like @michelandre said, it goes to /var/lib/nethserver/backup/

The main documentation says something about a post-backup event, i just thought it already had a place where i can put a script to be execute right after backup runs.

Backup

The main command is /sbin/e-smith/backup-config which starts the backup process (if enabled). The backup process has 3 steps:

  • pre-backup-config event: used to prepare data, for example a LDAP dump of users
  • backup-config-execute action: actually execute the backup if any file is changed in the last 24 hours. The backup file is saved in /var/lib/nethserver/backup/backup-config.tar.xz (see perldoc NethServer::BackupConfig )
  • post-backup-config event: used to post-process the backup file, for example to copy the backup to a remote server or encrypting the archive

I think I misunderstood it. I will just use a cron job, like @michelandre said :slight_smile:

Sorry, I was wrong, but for me it works like this:

  • Configuration Backup is saved at /var/lib/nethserver/backup
  • /var/lib/nethserver is copied by my Data Backup to the samba share

You can see, what is copied at

/etc/backup-data.d/

The Configuration Backup is copied by

/nethserver-base.include

1 Like

The place for post-backup-config scripts would be /etc/e-smith/events/post-backup-config/

2 Likes

Can’t find it at the docs, I think it should be added.

1 Like