diff options
author | Silvino Silva <silvino@bk.ru> | 2019-03-04 16:46:25 +0000 |
---|---|---|
committer | Silvino Silva <silvino@bk.ru> | 2019-03-04 16:46:25 +0000 |
commit | e0a5c6deb7ca4845763083ae7b4f6901e36deefc (patch) | |
tree | baf772a443f48c3dfa6e7c88adc4f68cd82b1e4b /core/scripts/backup-system.sh | |
parent | fed632cea589a4fc730dc852538cb40ca6f559fa (diff) | |
parent | 947ffc14fd8f0987d094210659bbacc38c1637f5 (diff) | |
download | doc-e0a5c6deb7ca4845763083ae7b4f6901e36deefc.tar.gz |
release 0.4.3
Diffstat (limited to 'core/scripts/backup-system.sh')
-rw-r--r-- | core/scripts/backup-system.sh | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/core/scripts/backup-system.sh b/core/scripts/backup-system.sh index 7faf676..17c8c6a 100644 --- a/core/scripts/backup-system.sh +++ b/core/scripts/backup-system.sh @@ -193,77 +193,3 @@ do *) echo "Please enter only y or n" esac done - -# Port System -while true -do - echo "Backup Port System ?" - echo "Please confirm (y or n) :" - read CONFIRM - case $CONFIRM in - n|N|no|NO|No) break ;; - y|Y|YES|yes|Yes) - echo "Accept - you entered $CONFIRM" - - # archive pkgutils data - tar --xattrs -zcpf $DEST_SYS/pkg-db.tar.gz \ - /var/lib/pkg/db - - # archive ports data - tar --xattrs -zcpf $DEST_SYS/etc_ports.tar.gz \ - --directory=/etc/ports \ - . - - METADATA=${DEST_SYS}/meta-data - mkdir -p $METADATA - - # must be using gwak instead of sed - prt-get listinst -v | sed 's/ /#/g' | sed 's/$/.pkg.tar.gz/g' > ${METADATA}/all-installed.pkg - - for filename in /etc/ports/*.git; do - source $filename - - # backup ports collection - echo "Backing up collection: $NAME" - tar --xattrs -zcpf $PORT_PRT/${NAME}-ports.tar.gz \ - --directory=$ROOT_DIR/usr/ports/${NAME} \ - --exclude=.git/ \ - . - - - # create list of installed packages - prt-get printf "%i %p %n\n" | grep "yes /usr/ports/${NAME}" | cut -d " " -f 3 > ${METADATA}/${NAME}-installed.pkg - - # backup collection packages - while read line; do - echo "Backing up package: ${NAME}/${line}" - # get installed version not version on ports - PACKAGE="$(cat ${METADATA}/all-installed.pkg | grep "^${line}#")" - if [ ! -f /usr/ports/packages/${PACKAGE} ]; then - echo "Building package: ${PACKAGE};\n" - sudo prt-get update -fr -if -is ${line} - (cd /usr/ports/${NAME}/${line} \ - && sudo pkgmk -uf) - fi - - if [ -f /usr/ports/packages/${PACKAGE} ]; then - echo ${PACKAGE} >> ${METADATA}/${NAME}-backup.pkg - #cp /usr/ports/packages/${PACKAGE} ${PORT_PKG}/${NAME}/ - tar rvf ${PORT_PKG}/${NAME}.tar \ - --directory=/usr/ports/packages \ - ${PACKAGE} - else - echo "Package $PORT_NAME not found: ${line}" - echo ${PACKAGE} >> ${METADATA}/${NAME}-notfound.pkg - fi - done < ${METADATA}/${NAME}-installed.pkg - done - break - ;; - *) echo "Please enter only y or n" - esac -done - -RELEASE_NAME=$(basename ${DEST_DIR}) -cd $(dirname ${DEST_DIR}) && tar -zcpf ${RELEASE_NAME}.tar.gz ${RELEASE_NAME}/ -rm -rf ${DEST_DIR} |