- #!/bin/bash
- set -euo pipefail
-
- if [[ ! -d "$1" ]] ; then
- echo "Target directory $1 does not exist!"
- exit
- fi
-
- set -x
-
- cd "$1"
- upload="$(basename "$(pwd)")"
- export CUR_SIZE=$( du -B1 -s . | grep -oE "^[0-9]+" )
- export YEAR=`date +%Y`
- echo ia upload "archiveteam_archivebot_go_${upload}" * \
- --sleep=120 \
- --retries=100 \
- --metadata="noarchivetorrent:true" \
- --metadata="size-hint:${CUR_SIZE}" \
- --metadata="mediatype:web" \
- --metadata="description:ArchiveBot is an Archive Team service to quickly grab smaller at-risk or critical sites to bring copies into the Internet Archive Wayback machine." \
- --metadata="title: Archiveteam: Archivebot GO Pack ${upload}" \
- --metadata="collection:archivebot" \
- --metadata="creator:Archive Team" \
- --metadata="date:${YEAR}" \
- --checksum \
- --delete
-
- # TEST SLEEP
- sleep 6000
-
- cd ..
- echo rmdir "$upload"
|