summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jeremiah Dow <jeremdow@gmail.com> 2011-04-02 19:36:30 -0400
committerGravatar Jeremiah Dow <jeremdow@gmail.com> 2011-04-02 19:36:30 -0400
commitf4ecc25ea9d4b7e67f8ab68bf240ca439f462262 (patch)
treeb7c12fa14681a725b24d4b69510207b95b9352cd
parent11f363f5cbdba7b0390bc90b24de712cc62762bf (diff)
downloadbin-f4ecc25ea9d4b7e67f8ab68bf240ca439f462262.tar.gz
retab
-rwxr-xr-xbackup46
-rwxr-xr-xbuild-queue6
-rwxr-xr-xhanoi-backup26
-rwxr-xr-xplay4
-rwxr-xr-xwordpress-export64
5 files changed, 73 insertions, 73 deletions
diff --git a/backup b/backup
index 3191ed0..c34c7e3 100755
--- a/backup
+++ b/backup
@@ -2,28 +2,28 @@
dest='jeremdow.com'
hostname=`hostname`
rsync -Pavze ssh --delete \
- --exclude /etc/.pwd.lock \
- --exclude /etc/crypttab \
- --exclude /etc/group- \
- --exclude /etc/gshadow \
- --exclude /etc/gshadow- \
- --exclude /etc/passwd- \
- --exclude /etc/shadow \
- --exclude /etc/shadow- \
- --exclude /etc/sudoers \
- --exclude /etc/sudoers.d \
- --exclude /etc/polkit-1/localauthority \
- --exclude /etc/ppp/chap-secrets \
- --exclude /etc/ppp/pap-secrets \
- --exclude /etc/mtab.fuselock \
- --exclude ~/.adobe \
- --exclude ~/.cache \
- --exclude ~/.config/chromium \
- --exclude ~/.dbus \
- --exclude ~/.git \
- --exclude ~/.macromedia \
- --exclude ~/bin/.git \
- --exclude ~/src/.git \
- --exclude ~/Downloads \
+ --exclude /etc/.pwd.lock \
+ --exclude /etc/crypttab \
+ --exclude /etc/group- \
+ --exclude /etc/gshadow \
+ --exclude /etc/gshadow- \
+ --exclude /etc/passwd- \
+ --exclude /etc/shadow \
+ --exclude /etc/shadow- \
+ --exclude /etc/sudoers \
+ --exclude /etc/sudoers.d \
+ --exclude /etc/polkit-1/localauthority \
+ --exclude /etc/ppp/chap-secrets \
+ --exclude /etc/ppp/pap-secrets \
+ --exclude /etc/mtab.fuselock \
+ --exclude ~/.adobe \
+ --exclude ~/.cache \
+ --exclude ~/.config/chromium \
+ --exclude ~/.dbus \
+ --exclude ~/.git \
+ --exclude ~/.macromedia \
+ --exclude ~/bin/.git \
+ --exclude ~/src/.git \
+ --exclude ~/Downloads \
/home /etc /boot/grub/menu.lst \
$dest:~/backup/$hostname
diff --git a/build-queue b/build-queue
index 74a36a3..41b8124 100755
--- a/build-queue
+++ b/build-queue
@@ -1,6 +1,6 @@
#!/bin/sh
# output packages not built by me
pacman -Qi | \
- awk -F ": " '/Name/ { printf "%-30s", $2 }
- /Packager/ { print $2 }' | \
- awk '! /(jeremdow@gmail.com)/ { print $1 }'
+ awk -F ": " '/Name/ { printf "%-30s", $2 }
+ /Packager/ { print $2 }' | \
+ awk '! /(jeremdow@gmail.com)/ { print $1 }'
diff --git a/hanoi-backup b/hanoi-backup
index c55bc75..276e1b8 100755
--- a/hanoi-backup
+++ b/hanoi-backup
@@ -67,29 +67,29 @@ echo
# Calculate the previous move in the cycle
((day=$(date +%s)/86400))
for (( i=1; i<=$max/2; i=2*i ))
- do
- (( rotation=$day & i ))
- if [ "$rotation" -eq "0" ]
- then
- (( expired=$i*2 ))
- break
- else
- expired="4"
- fi
+ do
+ (( rotation=$day & i ))
+ if [ "$rotation" -eq "0" ]
+ then
+ (( expired=$i*2 ))
+ break
+ else
+ expired="4"
+ fi
done
# Remove the expired backups
expired_mysql=$hostname-$(date -d "$expired days ago" +%F).sql.xz
echo "Attempting to remove expired backup: $expired_mysql"
if [ -f $dest/$expired_mysql ]
- rm "$dest/$expired_mysql"
- echo
+ rm "$dest/$expired_mysql"
+ echo
fi
expired_file=$hostname-$(date -d "$expired days ago" +%F).tar.xz
echo "Attempting to remove expired backup: $expired_file"
if [ -f $dest/$expired_file ]
- rm "$dest/$expired_file"
- echo
+ rm "$dest/$expired_file"
+ echo
fi
# Finished
diff --git a/play b/play
index 0407e30..e587bf6 100755
--- a/play
+++ b/play
@@ -1,9 +1,9 @@
#!/bin/sh
if [ "$1" ]
then
- path="$HOME/Music"
+ path="$HOME/Music"
else
- path=`pwd`
+ path=`pwd`
fi
find "$path" -iname "*$1*.???" | sort > $HOME/Music/playlist
mplayer -playlist $HOME/Music/playlist
diff --git a/wordpress-export b/wordpress-export
index 0b14e1e..9aadff6 100755
--- a/wordpress-export
+++ b/wordpress-export
@@ -8,18 +8,18 @@ read dbpwd
stty echo
posts(){
- mysql -p$dbpwd -D$db -s -e "SELECT ID from wp_posts WHERE post_status = 'publish' AND post_type = 'post';"
+ mysql -p$dbpwd -D$db -s -e "SELECT ID from wp_posts WHERE post_status = 'publish' AND post_type = 'post';"
}
selpost() {
- mysql -p$dbpwd -D$db -s -e "SELECT $1 FROM wp_posts WHERE ID = $2;"
+ mysql -p$dbpwd -D$db -s -e "SELECT $1 FROM wp_posts WHERE ID = $2;"
}
lastrev() {
- mysql -p$dbpwd -D$db -s -e "SELECT MAX(ID) FROM wp_posts WHERE post_parent = $1;"
+ mysql -p$dbpwd -D$db -s -e "SELECT MAX(ID) FROM wp_posts WHERE post_parent = $1;"
}
if [ -d archives ]
then
- rm -rf archives
+ rm -rf archives
fi
mkdir archives
cd ./archives
@@ -27,34 +27,34 @@ cd ./archives
posts > ../posts
while read line
do
- date=`selpost post_date $line`
- year=`echo $date | awk -F'-' '{print $1}'`
- if [ ! -d $year ]
- then
- mkdir $year
- fi
- month=`echo $date | awk -F'-' '{print $2}'`
- if [ ! -d $year/$month ]
- then
- mkdir $year/$month
- fi
- day=`echo $date | awk -F'-' '{print $3}' | awk '{print $1}'`
- if [ ! -d $year/$month/$day ]
- then
- mkdir $year/$month/$day
- fi
- current=`lastrev $line`
- post_title=`selpost post_title $current`
- echo $post_title > ../post
- echo -e '=========================================\n' >> ../post
+ date=`selpost post_date $line`
+ year=`echo $date | awk -F'-' '{print $1}'`
+ if [ ! -d $year ]
+ then
+ mkdir $year
+ fi
+ month=`echo $date | awk -F'-' '{print $2}'`
+ if [ ! -d $year/$month ]
+ then
+ mkdir $year/$month
+ fi
+ day=`echo $date | awk -F'-' '{print $3}' | awk '{print $1}'`
+ if [ ! -d $year/$month/$day ]
+ then
+ mkdir $year/$month/$day
+ fi
+ current=`lastrev $line`
+ post_title=`selpost post_title $current`
+ echo $post_title > ../post
+ echo -e '=========================================\n' >> ../post
- # pass the latest revision to html2text: https://github.com/aaronsw/html2text.git
- echo -e `selpost post_content $current | html2text` >> ../post
-
- count=`ls -1 $year/$month/$day | wc -l`
- mkdir $year/$month/$day/$count
- cat ../post > $year/$month/$day/$count/index.md
- echo $year/$month/$day/$count/index.md
- rm ../post
+ # pass the latest revision to html2text: https://github.com/aaronsw/html2text.git
+ echo -e `selpost post_content $current | html2text` >> ../post
+
+ count=`ls -1 $year/$month/$day | wc -l`
+ mkdir $year/$month/$day/$count
+ cat ../post > $year/$month/$day/$count/index.md
+ echo $year/$month/$day/$count/index.md
+ rm ../post
done < ../posts
rm ../posts