-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitar
More file actions
26 lines (26 loc) · 722 Bytes
/
vitar
File metadata and controls
26 lines (26 loc) · 722 Bytes
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
#!/bin/zsh
vitar()
{
printf 'File name: '
read OrigFile
printf 'Archive name: '
read ArchName
GZIP='--best'
XZ_OPT=-9 tar cJvf ../Documents/Archives/Operating\ Systems/"$ArchName" $OrigFile 2&> /dev/null & disown; ArchPID=$!
x=1
OrigSize=$(du -sh $OrigFile | awk '{print $1;}')
while [ $x = 1 ]
do
if ps -p $ArchPID
then ArchSize=$(du -sh ../Documents/Archives/Operating\ Systems/"$ArchName" | awk '{print $1;}')
clear
printf $ArchName'\n'$ArchSize' of '$OrigSize'\nArchiving...\n'
sleep 1
else
ArchSize=$(du -sh ../Documents/Archives/Operating\ Systems/"$ArchName" | awk '{print $1;}')
clear
printf $ArchName'\n'$ArchSize' vs '$OrigSize'\nDone.\n'
x=0
fi
done
}