-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchiver
More file actions
executable file
·89 lines (84 loc) · 2.63 KB
/
archiver
File metadata and controls
executable file
·89 lines (84 loc) · 2.63 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/tcsh
if( $1 == "" ) then
echo "archiver <destination directory> <dirlist>"
echo "tars all directories, puts in the archive, leaves a note in the file called monitor when finished"
echo "The directories Archived and Skip are not archived"
echo "dirlist is optional, defaults to all dirs"
echo "if tm issupplied as the second argument, only Meta and TD???? will be archived"
else
set ArchName = Archived
set DestName = $1
if( $DestName == guess ) then
if( ! -e arch_dir ) then
echo "No arch_dir. Can't guess"
exit
endif
set DestName = `cat arch_dir`
endif
set SkipName = Skip
if( ! ( -e $ArchName ) ) then
mkdir $ArchName
endif
if( $#argv > 1 ) then
if( $2 == "td" ) then
set directory_list = `lusg TD`
set directory_list = "$directory_list `lusg DD`"
set directory_list = "$directory_list Meta PreviousRunTracker"
else
set directory_list = ""
set counter = 2
while($counter <= $#argv )
set directory_list = "$directory_list $argv[$counter]"
@ counter = $counter + 1
end
endif
else
#set directory_list = `dirlist`
echo "Do you really want to call archiver with no directories?"
exit
endif
foreach i ($directory_list)
set ArchThisSet = True
if( ($i == $ArchName) || ($i == $SkipName) || ($i == kill) || (`echo $i |cut -c -2` == 'CD') ) then
set ArchThisSet = False
endif
if( -e monitor ) then
if( `grep $i monitor |wc -l` != 0) then
set ArchThisSet = False
endif
else
touch monitor
endif
if( ! -e monitor_log ) touch monitor_log
if( $i == Meta || $i == PreviousRunTracker ) then
set ArchThisSet = True
endif
echo $DestName >> monitor
date >> monitor
if( $ArchThisSet == True) then
echo "tar and feather" $i
if( 0 == 0 ) then
set tarstatus = -666
if( `which mssftp |cut -c 1 ` == "/" ) then
echo msscmd "tar cvf $DestName/$i.tar $i"
msscmd "tar cvf $DestName/$i.tar $i"
set tarstatus = $status
else if ( `which hsi | cut -c 1 ` == "/" ) then
echo "htar cvf $DestName/$i.tar $i"
htar cvf $DestName/$i.tar $i |& tee -a monitor_log
set tarstatus = $status
else
echo "Archive Command not found."
exit -1
endif
if( $tarstatus == 0) then
echo $i >> monitor
else
echo $i PROBLEM!!!!
endif
endif #machine off switch
else
echo skip $i
endif
end
#end