From 83fd883a2e9e6ca60702a2f2e1e5742eee56da7d Mon Sep 17 00:00:00 2001 From: Thomas C Date: Thu, 29 Sep 2022 15:11:57 +0000 Subject: [PATCH] test dir existence --- backup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backup.sh b/backup.sh index 7cb7a18..d3afeff 100644 --- a/backup.sh +++ b/backup.sh @@ -4,3 +4,9 @@ if [ $UID -ne 0 ] ; then echo "need root" exit 1 fi + +for dir in "$@" ; do + test -d $dir || { echo $dir dont exist ; continue ; } + echo cp -a $dir bkpdir/ +done +