-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrtl_clean_backup
74 lines (70 loc) · 2.82 KB
/
rtl_clean_backup
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
triumph_directory="/home/vascom/triumph40"
unenc_mount_point="/home/vascom/unenc"
function directory_copy() {
if [ -e ~/unenc/triumph2/$1/ ]
then
mkdir /tmp/rtl_clean_backup_$1/
if [ "$1" == "doc" ]
then
scp -rq vglazov@systech7:/home/vglazov/triumph40n/trunk/$1/[dst]* /tmp/rtl_clean_backup_$1/
elif [ "$1" == "sim" ]
then
scp -rq vglazov@systech7:/home/vglazov/triumph40n_2/trunk/sim/program_tests /tmp/rtl_clean_backup_$1/
else
# scp -rq vglazov@systech7:/home/vglazov/triumph40n/trunk/$1/* /tmp/rtl_clean_backup_$1/
cp -r /home/vascom/triumph40/$1/* /tmp/rtl_clean_backup_$1/
fi
du -hs /tmp/rtl_clean_backup_$1
find /tmp/rtl_clean_backup_$1 -name ".svn" -exec rm -rf {} \; 2>/dev/null
find /tmp/rtl_clean_backup_$1 -name "work" -exec rm -rf {} \; 2>/dev/null
find /tmp/rtl_clean_backup_$1 -name "Makefile*" -delete
find /tmp/rtl_clean_backup_$1 -name "*~" -delete
find /tmp/rtl_clean_backup_$1 -name "*.bak" -delete
find /tmp/rtl_clean_backup_$1 -name "config.makefile" -delete
du -hs /tmp/rtl_clean_backup_$1
cp -ru /tmp/rtl_clean_backup_$1/* ~/unenc/triumph2/$1/
rm -rf /tmp/rtl_clean_backup_$1
else
echo "~/unenc/$1 not mounted"
fi
}
function directory_copy_local() {
if [ -e $unenc_mount_point/triumph2/$1/ ]
then
mkdir /tmp/rtl_clean_backup_$1
if [ "$1" == "doc" ]
then
cp -r $triumph_directory/$1/[dst]* /tmp/rtl_clean_backup_$1/
elif [ "$1" == "sim" ]
then
cp -r $triumph_directory/sim/program_tests /tmp/rtl_clean_backup_$1/
else
cp -r $triumph_directory/$1/* /tmp/rtl_clean_backup_$1/
fi
du -hs /tmp/rtl_clean_backup_$1
find /tmp/rtl_clean_backup_$1 -name ".svn" -exec rm -rf {} \; 2>/dev/null
find /tmp/rtl_clean_backup_$1 -name "work" -exec rm -rf {} \; 2>/dev/null
find /tmp/rtl_clean_backup_$1 -name "Makefile*" -delete
find /tmp/rtl_clean_backup_$1 -name "*~" -delete
find /tmp/rtl_clean_backup_$1 -name "*.bak" -delete
#find /tmp/rtl_clean_backup_$1 -name "config.makefile" -delete
du -hs /tmp/rtl_clean_backup_$1
cp -ru /tmp/rtl_clean_backup_$1/* $unenc_mount_point/triumph2/$1/
rm -rf /tmp/rtl_clean_backup_$1
else
echo "$unenc_mount_point$1 not mounted"
fi
}
case "$1" in
"rtl" ) directory_copy_local rtl;;
"doc" ) directory_copy_local doc;;
"model" ) directory_copy_local model;;
"sim" ) directory_copy_local sim;;
"" )
directory_copy_local rtl
directory_copy_local doc
directory_copy_local model
directory_copy_local sim
;;
esac