Koozali.org: home of the SME Server

DAR and --go-into and --include

Offline michelandre

  • *
  • 261
  • +0/-0
DAR and --go-into and --include
« on: June 16, 2018, 03:43:34 AM »
Hi all,

I want to include the file: var/lib/pgsql/10/data/pg_hba.conf into the standard backup.


Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf

chmod 600 /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf

cat > /etc/e-smith/templates-custom/etc/dar/DailyBackup.dcf/41go-into <<'EOT'
--go-into opt
--go-into var/lib/pgsql/sauvegarde
--include var/lib/pgsql/10/data/pg_hba.conf
EOT

expand-template /etc/dar/DailyBackup.dcf

/sbin/e-smith/do_backupwk

In Server Manager, in restore file...
- I can see directories /opt and /var/lib/pgsql/sauvegarde but not the file /var/lib/pgsql/10/data/pg_hba.conf.
- I can restore all the contents of the directories.
- I can not restore the file /var/lib/pgsql/10/data/pg_hba.conf as it is not in the backup.

In: https://wiki.contribs.org/Backup_with_dar

Quote
--include path/to/file/sampleFileName.txt
 --include "*.backMeUp"

--include "*pg_hba.conf" doesn't work either.

If I only insert --include var/lib/pgsql/10/data/pg_hba.conf, the full backup stops at 299KB.

Full backup with only the directories /opt and /var/lib/pgsql/sauvegarde included, the backup files are:
full-20180615195352.1.dar = 716800Kb
full-20180615195352.2.dar = 275897Kb

Any help appreciated,

Michel-André

Offline michelandre

  • *
  • 261
  • +0/-0
Re: DAR and --go-into and --include
« Reply #1 on: June 16, 2018, 03:59:15 AM »
In /etc/e-smith/templates/etc/dar/DailyBackup.dcf, there are:
40go-into (some code inside)
50exclude (empty)

Maybe it needs also fragments:
include
prune

Michel-André

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: DAR and --go-into and --include
« Reply #2 on: June 16, 2018, 09:53:23 AM »
michelandre

Despite what the wiki says about --include, try

--go-into var/lib/pgsql/10/data/pg_hba.conf

That style is what is used in a custom template I have.
I cannot check at the moment if that is actually working (backing up the file), but it appears to be derived from original sme server code (ie a different filename of course), as it has been there a long time.
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: DAR and --go-into and --include
« Reply #3 on: June 16, 2018, 10:22:33 AM »
Or you can try another way: templatize you conf file and you're done

Offline michelandre

  • *
  • 261
  • +0/-0
Re: DAR and --go-into and --include
« Reply #4 on: June 16, 2018, 02:25:25 PM »
Hi Janet,

Thank you for for reply - it works.

Should I report a "bug" in the documentation for: https://wiki.contribs.org/Backup_with_dar?

Michel-André

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: DAR and --go-into and --include
« Reply #5 on: June 16, 2018, 10:43:39 PM »
michelandre

Yes, but it might be code or documentation.

Quote
Should I report a "bug" in the documentation
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.