Hiii,
i have a doubt here--
DirCleanupList="logs tmp corefiles"
echo "$DirCleanupList" | perl -ne 'print join("\n", split(" ")) . "\n"; '
for dir in $DirCleanupList
do
BackupLocation="$BackupLocation/$dir"
mkdir -p $BackupLocation >/dev/null 2>&1
if [[ ! -d $BackupLocation ]]; then
echo "Unable to make backup directory: $BackupLocation"
continue
fi
done
I have to take backup of all the files inside directory dir(logs,tmp,corefiles) at the location $BackupLocation.i should take the backup of logs,tmp,corefiles inside the $BackupLocation directory and then remove the files and touch the files inside the directory dir(logs,tmp,corefiles).
else we can move the files from dir(logs,corefiles,tmp) to $BackupLocation then touch the file inside dir(logs,tmp,corefiles).
i appericicate your quick help.