diff --git a/backupsd b/backupsd index 0c3d5b0..6410daf 100755 --- a/backupsd +++ b/backupsd @@ -6,6 +6,20 @@ verbose=false testmode=false bzip2=false +if [ $# -ne 2 ] +then + echo "Usage: backupsd " + echo "Please try again." + exit 1 +fi + +if !command -v dd > /dev/null 2>&1 +then + echo "required command dd is not installed." + echo " Please check." + exit 2 +fi + function isolate_checksum() { checksum=($(echo ${1} | tr " " "\n"[0])) diff --git a/rmoldest.sh b/purgerepo.sh similarity index 89% rename from rmoldest.sh rename to purgerepo.sh index fb7483c..980fc1b 100755 --- a/rmoldest.sh +++ b/purgerepo.sh @@ -6,6 +6,7 @@ files_to_remove=$(find . -maxdepth 1 -type f|cut -c3-|xargs ls -t|tail -3) echo "eldest files ${files_toremove}" for backupfile in ${files_to_remove}; do echo "deleting backup ${backupfile}" + rm -f "${backupfile}" done