Page 1 of 1

restore all files

Posted: 20 Dec 2012, 19:58
by muchacho
hello,

how i make restore all files and of the all account users in one time?

thanks

Re: restore all files

Posted: 20 May 2013, 13:06
by BahaaHeiba
I have created a bach script for this action, so you can create the script and run it after editing the pathes of scan directoy under quarantin dir (/backup/cxs/safe/scan/) :

#!/bin/bash
for u in `/bin/ls -1 /backup/cxs/safe/scan/` ;
do
echo $u ;
for l1 in `/bin/ls -1 /backup/cxs/safe/scan/$u/*.restore`;
do
F1=$(awk 'NR==2' $l1);
F2=$(awk 'NR==5' $l1);
mv $F1 $F2;
rm -f $l1;
done
echo "User '$u' CXS files are restored";
done