diff --git a/active-users.sh b/active-users.sh deleted file mode 100755 index 40e7bb0..0000000 --- a/active-users.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -echo -n "$(date --iso-8601) " -for i in 1 10 20 30 -do - echo -n "$i day(s): $(find /srv/www/greptweet.com/u -maxdepth 1 -mindepth 1 -type d -mtime -$i | wc -l), " -done - -echo Total: $(find /srv/www/greptweet.com/u -maxdepth 1 -mindepth 1 -type d | wc -l) diff --git a/backup/create-greptweet-backup.sh b/backup/create-greptweet-backup.sh new file mode 100755 index 0000000..77bf14c --- /dev/null +++ b/backup/create-greptweet-backup.sh @@ -0,0 +1,8 @@ +#!/bin/bash -ex +cd "${BASH_SOURCE%/*}" || exit 1 +bundleDir=$PWD +wwwdir=/srv/www/backup.greptweet.com +cd /mnt/2tb/greptweet || exit 1 +rsync -trvi --exclude 'tweets.txt.gz' --include '*/' --include '*.txt.gz' --exclude '*' --prune-empty-dirs core:/srv/www/greptweet.com/ . &> $wwwdir/rsync.log +find -name '*.gz' -type f -print0 | tar cf $wwwdir/tweets.tar --null -T - +$bundleDir/index.sh $wwwdir > $wwwdir/index.html diff --git a/backup/index.sh b/backup/index.sh new file mode 100755 index 0000000..7faef49 --- /dev/null +++ b/backup/index.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +test -d $1 || exit + +cd $1 + +cat < + + +$(tar -tf tweets.tar | wc -l) twitter accounts + + + +

Greptweet.com $(date --rfc-3339=date -r tweets.tar) backup

+

+$(du -sh tweets.tar) +

+ + +EOF