aboutsummaryrefslogtreecommitdiff
path: root/mkar
blob: abcc41df06c8f09fb9d292615aecbb01c56e0766 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/rc
rfork en
wdir=$home/lib/fitness
years=(2020 2021 2022)
months=(jan feb mar apr may jun jul aug sep oct nov dec)

mkdir -p $wdir/archive

for(y in $years)
	for(m in $months)
		if(! ~ `{ls *$m$y >[2]/dev/null | wc -l} 0){
			tar cvzf $m$y.tgz *$m$y
			mv $m$y.tgz $wdir/archive/
			rm *$m$y
		}