Commit e134de4dec6f3a0e04d544a74a39c1695928b36a

Authored by Paulo Graça
1 parent 5971957842

Changed the export and verify methods

dspace/bin/RCAAP-packager-export_verify-items.sh
... ... @@ -80,11 +80,11 @@ if [ -z "$BACKUP_DIR" ]; then
80 80 BACKUP_DIR="${SCRIPTPATH}/../exports"
81 81 fi
82 82  
83   -#first, retrive the number of archived items in database
84   -NUMBER_ITEMS=(`echo "SELECT count(*) FROM item WHERE in_archive=TRUE;" | psql -tU postgres dspace|sed 's| ||g'`)
  83 +#first, retrive the number of archived items in database associated with a prefix
  84 +NUMBER_ITEMS=(`echo "SELECT count(*) FROM item LEFT JOIN handle ON item.item_id = handle.resource_id AND handle.resource_type_id = 2 AND handle.handle LIKE '${HANDLE_PREFIX}/%' WHERE in_archive=TRUE AND handle.handle IS NOT NULL;" | psql -tU postgres dspace|sed 's| ||g'`)
85 85  
86 86 #export AIP packages
87   -${SCRIPTPATH}/dspace packager -d -a -u -t AIP -e ${EMAIL} -i ${HANDLE_PREFIX}/0 ${BACKUP_DIR}/sitewide-aip.zip &> ${LOG_FILE}
  87 +${SCRIPTPATH}/dspace packager -d -a -u -t AIP -e ${EMAIL} -i ${HANDLE_PREFIX}/0 ${BACKUP_DIR}/${HANDLE_PREFIX}-aip.zip &> ${LOG_FILE}
88 88  
89 89 #find on the backup directory and count the number of just created files
90 90 NUMBER_BACKUPS=(`find $BACKUP_DIR -mtime 0 ! -size 0 -type f -name "ITEM*.zip" | wc -l`)
... ...