toniblyx / alfresco-backup-and-recovery-tool

Alfresco BART is a tool written in shell script on top of Duplicity to do Alfresco backups and restore from a local file system, FTP, SCP or Amazon S3.
Apache License 2.0
96 stars 48 forks source link

General Help #24

Closed AmeliaEnslin closed 4 years ago

AmeliaEnslin commented 7 years ago

Hi there

I followed your instructions on how to use the bart.sh changed the necessary as recommended, but when i run the ./alfresco-bart.sh backup [all] i get the following errors:

which: no duplicity in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin) ./alfresco-bart.sh: line 121: -v4: command not found ./alfresco-bart.sh: line 124: -v4: command not found ./alfresco-bart.sh: line 165: -v4: command not found ./alfresco-bart.sh: line 222: -v4: command not found ./alfresco-bart.sh: line 269: -v4: command not found ./alfresco-bart.sh: line 769: remove-older-than: command not found ./alfresco-bart.sh: line 771: remove-all-inc-of-but-n-full: command not found ./alfresco-bart.sh: line 773: remove-older-than: command not found ./alfresco-bart.sh: line 774: remove-all-inc-of-but-n-full: command not found ./alfresco-bart.sh: line 788: remove-older-than: command not found ./alfresco-bart.sh: line 790: remove-all-inc-of-but-n-full: command not found

I then check my log files 👍 2017-03-28-04:54:22 AM - [BART-Loglevel4] Starting backup 2017-03-28-04:54:22 AM - [BART-Loglevel4] Set script varibles done 2017-03-28-04:54:22 AM - [BART-Loglevel4] Backing up the Alfresco indexes to local 2017-03-28-04:54:22 AM - [BART-Loglevel4] Starting backup - Alfresco solr indexes 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - -v4 --volsize=25 --log-file=/opt/alfresco/scripts/alfresco-bart-2017-03-28.log --full-if-older-than 30D --asynchronous-upload /opt/alfresco/alf_data/solr4Backup file:///var/backups/solr 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - -v4 --volsize=25 --log-file=/opt/alfresco/scripts/alfresco-bart-2017-03-28.log --full-if-older-than 30D --asynchronous-upload /opt/alfresco/alf_data/solr --exclude /opt/alfresco/alf_data/solr/archive --exclude /opt/alfresco/alf_data/solr/workspace file:///var/backups/solr/config 2017-03-28-04:54:22 AM - [BART-Loglevel4] Indexes backup finished 2017-03-28-04:54:22 AM - [BART-Loglevel4] Backing up the Alfresco db to local 2017-03-28-04:54:22 AM - [BART-Loglevel4] Starting backup - Alfresco postgresql db 2017-03-28-04:54:22 AM - [BART-Loglevel4] Backing up the Alfresco DB to local 2017-03-28-04:54:22 AM - [BART-Loglevel4] Starting backup - Alfresco postgresql DB 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - /opt/alfresco/postgresql/bin/pg_dump --host=localhost --username=alfresco --format=p --compress=9 --file=/opt/alfresco/alf_data/alfresco-db-backup/alfresco.dump alfresco -w 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - -v4 --volsize=25 --log-file=/opt/alfresco/scripts/alfresco-bart-2017-03-28.log --full-if-older-than 30D --asynchronous-upload /opt/alfresco/alf_data/alfresco-db-backup file:///var/backups/postgresql 2017-03-28-04:54:22 AM - [BART-Loglevel4] cleaning DB backup 2017-03-28-04:54:22 AM - [BART-Loglevel4] DB backup finished 2017-03-28-04:54:22 AM - [BART-Loglevel4] Backing up the Alfresco ContentStore to local 2017-03-28-04:54:22 AM - [BART-Loglevel4] Starting backup - Alfresco ContentStore 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - -v4 --volsize=25 --log-file=/opt/alfresco/scripts/alfresco-bart-2017-03-28.log --full-if-older-than 30D --asynchronous-upload --include /opt/alfresco/alf_data/contentstore --exclude /opt/alfresco/alf_data /opt/alfresco/alf_data file:///var/backups/cs 2017-03-28-04:54:22 AM - [BART-Loglevel4] ContentStore backup done! 2017-03-28-04:54:22 AM - [BART-Loglevel4] Backing up the Alfresco files to local 2017-03-28-04:54:22 AM - [BART-Loglevel4] Starting backup - Alfresco files 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - -v4 --volsize=25 --log-file=/opt/alfresco/scripts/alfresco-bart-2017-03-28.log --full-if-older-than 30D --asynchronous-upload /opt/alfresco --exclude /opt/alfresco/alf_data/solr4Backup --exclude /opt/alfresco/alf_data/contentstore --exclude /opt/alfresco/alf_data/contentstore.deleted --exclude /opt/alfresco/alf_data/alfresco-db-backup file:///var/backups/files 2017-03-28-04:54:22 AM - [BART-Loglevel4] Files backup done! 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running maintenance commands 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - remove-older-than 12M -v4 --log-file=/opt/alfresco/scripts/alfresco-bart-2017-03-28.log --force --extra-clean file:///var/backups/solr/backup 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - remove-all-but-n-full 6 -v4 --log-file=/opt/alfresco/scripts/alfresco-bart-2017-03-28.log --force file:///var/backups/solr/backup 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - remove-older-than 12M -v4 --log-file=/opt/alfresco/scripts/alfresco-bart-2017-03-28.log --force --extra-clean file:///var/backups/postgresql 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - remove-all-but-n-full 6 -v4 --log-file=/opt/alfresco/scripts/alfresco-bart-2017-03-28.log --force file:///var/backups/postgresql 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - remove-older-than 12M -v4 --log-file=/opt/alfresco/scripts/alfresco-bart-2017-03-28.log --force --extra-clean file:///var/backups/cs ./alfresco-bart.sh: line 803: remove-older-than: command not found 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - remove-all-but-n-full 6 -v4 --log-file=/opt/alfresco/scripts/alfresco-bart-2017-03-28.log --force file:///var/backups/cs ./alfresco-bart.sh: line 805: remove-all-inc-of-but-n-full: command not found 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - remove-older-than 12M -v4 --log-file=/opt/alfresco/scripts/alfresco-bart-2017-03-28.log --force --extra-clean file:///var/backups/files ./alfresco-bart.sh: line 809: remove-older-than: command not found 2017-03-28-04:54:22 AM - [BART-Loglevel4] Running command - remove-all-but-n-full 6 -v4 --log-file=/opt/alfresco/scripts/alfresco-bart-2017-03-28.log --force file:///var/backups/files ./alfresco-bart.sh: line 811: remove-all-inc-of-but-n-full: command not found 2017-03-28-04:54:22 AM - [BART-Loglevel4] Maintenance commands DONE!

Where it says my backup is complete, but i cant find the backup anywhere, not in my local_dir or alf_data folder at all.

Am i doing something wrong?

toniblyx commented 7 years ago

Hi @AmeliaEnslin, it looks like you don't have Duplicity installed. Depending on your linux distribution you can install in in different ways. I should improve the error handling in the code, sorry, it is very bad managed so far.

Shadee159 commented 7 years ago

Hello @toniblyx I'm receiving similar errors.

duplicity is installed also, by using command (yum -y install duplicity).

Also don't know what command use to Duplicitybin and Gzip. Probably they aren't set and thats why is not working.

Duplicity Setup

If yes, please make sure you specify either PASSPHRASE, see INSTALL file.

ENCRYPTION_ENABLED=false PASSPHRASE= DUPLICITYBIN=which duplicity GZIP=which gzip

2017-03-31-11:11:43 AM - [BART-Loglevel4] Starting backup 2017-03-31-11:11:43 AM - [BART-Loglevel4] Set script varibles done 2017-03-31-11:11:43 AM - [BART-Loglevel4] Backing up the Alfresco indexes to local 2017-03-31-11:11:43 AM - [BART-Loglevel4] Starting backup - Alfresco solr4 indexes 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running command - -v4 --volsize=25 --log-file=/data/alfresco-community/scripts/alfresco-bart-2017-03-31.log --full-if-older-than 15D --asynchronous-upload --no-encryption /data/alfresco-community/alf_data/solr4Backup file:///data/backup/solr4 2017-03-31-11:11:43 AM - [BART-Loglevel4] Indexes backup finished 2017-03-31-11:11:43 AM - [BART-Loglevel4] Backing up the Alfresco db to local 2017-03-31-11:11:43 AM - [BART-Loglevel4] Starting backup - Alfresco postgresql db 2017-03-31-11:11:43 AM - [BART-Loglevel4] Backing up the Alfresco DB to local 2017-03-31-11:11:43 AM - [BART-Loglevel4] Starting backup - Alfresco postgresql DB 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running command - /data/alfresco-community/postgresql/bin/pg_dump --host=localhost --username=alfresco --format=p --compress=9 --file=/data/alfresco-community/alf_data/alfresco-db-backup/alfresco.dump alfresco -w 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running command - -v4 --volsize=25 --log-file=/data/alfresco-community/scripts/alfresco-bart-2017-03-31.log --full-if-older-than 15D --asynchronous-upload --no-encryption /data/alfresco-community/alf_data/alfresco-db-backup file:///data/backup/postgresql 2017-03-31-11:11:43 AM - [BART-Loglevel4] cleaning DB backup 2017-03-31-11:11:43 AM - [BART-Loglevel4] DB backup finished 2017-03-31-11:11:43 AM - [BART-Loglevel4] Backing up the Alfresco ContentStore to local 2017-03-31-11:11:43 AM - [BART-Loglevel4] Starting backup - Alfresco ContentStore 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running command - -v4 --volsize=25 --log-file=/data/alfresco-community/scripts/alfresco-bart-2017-03-31.log --full-if-older-than 15D --asynchronous-upload --no-encryption --include /data/alfresco-community/alf_data/contentstore --exclude /data/alfresco-community/alf_data /data/alfresco-community/alf_data file:///data/backup/cs 2017-03-31-11:11:43 AM - [BART-Loglevel4] ContentStore backup done! 2017-03-31-11:11:43 AM - [BART-Loglevel4] Backing up the Alfresco files to local 2017-03-31-11:11:43 AM - [BART-Loglevel4] Starting backup - Alfresco files 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running command - -v4 --volsize=25 --log-file=/data/alfresco-community/scripts/alfresco-bart-2017-03-31.log --full-if-older-than 15D --asynchronous-upload --no-encryption /data/alfresco-community --exclude /data/alfresco-community/alf_data/solr4Backup --exclude /data/alfresco-community/alf_data/solr4 --exclude /data/alfresco-community/alf_data/contentstore --exclude /data/alfresco-community/alf_data/contentstore.deleted --exclude /data/alfresco-community/alf_data/alfresco-db-backup file:///data/backup/files 2017-03-31-11:11:43 AM - [BART-Loglevel4] Files backup done! 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running maintenance commands 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running command - remove-older-than 12M -v4 --log-file=/data/alfresco-community/scripts/alfresco-bart-2017-03-31.log --force --extra-clean file:///data/backup/solr4/backup 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running command - remove-all-but-n-full 6 -v4 --log-file=/data/alfresco-community/scripts/alfresco-bart-2017-03-31.log --force file:///data/backup/solr4/backup 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running command - remove-older-than 12M -v4 --log-file=/data/alfresco-community/scripts/alfresco-bart-2017-03-31.log --force --extra-clean file:///data/backup/postgresql 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running command - remove-all-but-n-full 6 -v4 --log-file=/data/alfresco-community/scripts/alfresco-bart-2017-03-31.log --force file:///data/backup/postgresql 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running command - remove-older-than 12M -v4 --log-file=/data/alfresco-community/scripts/alfresco-bart-2017-03-31.log --force --extra-clean file:///data/backup/cs ./alfresco-bart.sh: line 801: remove-older-than: command not found 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running command - remove-all-but-n-full 6 -v4 --log-file=/data/alfresco-community/scripts/alfresco-bart-2017-03-31.log --force file:///data/backup/cs ./alfresco-bart.sh: line 803: remove-all-inc-of-but-n-full: command not found 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running command - remove-older-than 12M -v4 --log-file=/data/alfresco-community/scripts/alfresco-bart-2017-03-31.log --force --extra-clean file:///data/backup/files ./alfresco-bart.sh: line 807: remove-older-than: command not found 2017-03-31-11:11:43 AM - [BART-Loglevel4] Running command - remove-all-but-n-full 6 -v4 --log-file=/data/alfresco-community/scripts/alfresco-bart-2017-03-31.log --force file:///data/backup/files ./alfresco-bart.sh: line 809: remove-all-inc-of-but-n-full: command not found 2017-03-31-11:11:43 AM - [BART-Loglevel4] Maintenance commands DONE!

toniblyx commented 7 years ago

Hi @Shadee159 instead of using DUPLICITYBIN=which duplicity GZIP=which gzip

use full path of the binaries to make sure they are correct, for instance in Centos 7.3 would be: DUPLICITYBIN=/usr/bin/duplicity GZIP=/usr/bin/gzip

douglascrp commented 4 years ago

As we got no answer from the reporter, I am going to close this one.

Please, feel free to reopen it if required.