-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-reg
39 lines (25 loc) · 1.38 KB
/
make-reg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# подготовка всех каталогов для сканирования файлов
# будем сканировать каждый регион в свой файл !
#формировать будем с вложенными директориями - курент и превиосли месяцы
#echo $(date +"%y-%m-%d %T")
#в папку регионов почистить все файлы
for i in `cat ./031_notifications`; do
cat /dev/null > ./regions/${i}
cat /dev/null > ./regions/${i}_currMonth
cat /dev/null > ./regions/${i}_prevMonth
done
#формирование файла для закачивания инфы по всем регионам
#cat /dev/null > ./05_scan_notif.lftp
echo open ftp://free:[email protected]:21 > ./05_scan_notif.lftp;
for i in `cat ./031_notifications`; do
echo cd /fcs_regions/${i}/notifications/ >> ./05_scan_notif.lftp;
echo find -d 2 -l \>\> ./regions/${i} >> ./05_scan_notif.lftp;
echo cd /fcs_regions/${i}/notifications/currMonth >> ./05_scan_notif.lftp;
echo find -d 2 -l \>\> ./regions/${i}_currMonth >> ./05_scan_notif.lftp;
echo cd /fcs_regions/${i}/notifications/prevMonth >> ./05_scan_notif.lftp;
echo find -d 2 -l \>\> ./regions/${i}_prevMonth >> ./05_scan_notif.lftp;
done
echo exit >> ./05_scan_notif.lftp;
lftp -f ./05_scan_notif.lftp
##cat ./regions/* |grep "^-rw.*2018.*" > iv