Added exit code to CIS_ROOT_DIR test def, optimized sed and sort

This commit is contained in:
thibault.dewailly
2016-04-20 11:29:44 +02:00
parent 1d7865dd68
commit 3ece442743
194 changed files with 195 additions and 19 deletions

View File

@ -9,7 +9,7 @@ backup_file() {
crit "Cannot backup $FILE, it's not a file"
FNRET=1
else
TARGET=$(echo $FILE | sed -s 's/\//./g' | sed -s 's/^.//' | sed -s "s/$/.$(date +%F-%T)/" )
TARGET=$(echo $FILE | sed -s -e 's/\//./g' -e 's/^.//' -e "s/$/.$(date +%F-%H_%M_%S)/" )
TARGET="$BACKUPDIR/$TARGET"
debug "Backuping $FILE to $TARGET"
cp -a $FILE $TARGET