forked from nohuhu/echi-decode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uucp_copy
executable file
·42 lines (32 loc) · 1.01 KB
/
uucp_copy
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
38
39
40
41
#################################################################
# uucp_copy from_file_name to_file_name remote_system_name
#################################################################
USER=AvayaStatistics
BASE=`basename $1`
DATE=`date +%Y%m%d`
#
# converting binary to text
#
/cms/dc/chr/echi-decode.pl $1 /cms/dc/chr/processed/$BASE.$DATE.txt 2>> /cms/dc/chr/echi-decode.log
if [ $? -ne 0 ]
then
echo "/cms/dc/chr/echi-decode.pl $1 /cms/dc/chr/processed/$BASE.$DATE.txt" > /cms/dc/chr/$BASE.err
exit 1
fi
#
# transferring text file via scp
#
cp /cms/dc/chr/processed/$BASE.$DATE.txt /cms/dc/chr/queue/$BASE.txt
echo `date` >> /cms/dc/chr/scp_log
echo "Copying $BASE.$DATE.txt via scp as $BASE.txt" >> /cms/dc/chr/scp_log
/usr/bin/scp -v -i /etc/ssh-key /cms/dc/chr/queue/$BASE.txt $USER@$3: 2>> /cms/dc/chr/scp_log
if [ $? -ne 0 ]
then
echo "/usr/bin/scp -v -i /etc/ssh-key /cms/dc/chr/queue/$BASE.txt $USER@$3:" > /cms/dc/chr/$BASE.err
exit 2
fi
#
# cleaning up text file
#
rm /cms/dc/chr/queue/$BASE.txt
exit 0