Bash TidyUp

#!/bin/sh
#Note: Switch all "-vi" to "-f" if you know what you do!
#This script cleans up the cwd - guess how ;)
#I wrote this especially for my ~/ and ~/incoming directory.

SOUNDDIR=/home/beko/mp3
SOUNDFILES="*.mp3 *.ogg *.pls"
DOCDIR=/home/beko/txt
DOCFILES="*.txt *.sxd .*sxc *.sxw *.std *.pdf *.sxi *.xls *.doc *.lst"
LOGDIR=/home/beko/logs
LOGFILES="*.log"
IMGDIR=/home/beko/img
IMGFILES="*.jpg *.jpeg *.gif *.bmp *.xcf *.png *.pnm *.tga *.xpm *.pcx"
ARCHIVEDIR=/home/beko/progs
ARCHIVEFILES="*.zip *.gz *.bz2 *.rar"
HTMLDIR=/home/beko/txt/html
HTMLFILES="*.html *.htm *.php"
VIDEODIR=/home/beko/video
VIDEOFILES="*.mpg *.mpeg *.avi *.wmv *.mov"
SCRIPTDIR=/home/beko/scripts
SCRIPTFILES="*.tcl *.sh"

echo "Launched v0.1..."
echo -e "\nMoving Soundfiles..."
mv -vi $SOUNDFILES $SOUNDDIR
echo -e "\nMoving Videofiles..."
mv -vi $VIDEOFILES $VIDEODIR
echo -e "\nMoving Documents..."
mv -vi $DOCFILES $DOCDIR
echo -e "\nMoving Logs..."
mv -vi $LOGFILES $LOGDIR
echo -e "\nMoving Images..."
mv -vi $IMGFILES $IMGDIR
echo -e "\nMoving Archives..."
mv -vi $ARCHIVEFILES $ARCHIVEDIR
echo -e "\nMoving HTML files..."
mv -vi $HTMLFILES $HTMLDIR
echo -e "\nMoving scripts..."
mv -vi $SCRIPTFILES $SCRIPTDIR
echo -e "\nCheck your quota:"
df -h
echo -e "\nFinished..."

Schreibe einen Kommentar