Skip to content
Snippets Groups Projects
Commit 30f7d067 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Get rid of obsolete status files and backups.

* lysrdiff-move-obsolete: New script.  Move backups that are no
  longer mentioned in the task file to a separate place.
parent a082359f
No related branches found
No related tags found
No related merge requests found
2006-12-19 Per Cederqvist <ceder@sedesopim.lysator.liu.se>
Get rid of obsolete status files and backups.
* lysrdiff-move-obsolete: New script. Move backups that are no
longer mentioned in the task file to a separate place.
2006-11-29 Per Cederqvist <ceder@sedesopim.lysator.liu.se>
Guard against running two fetch-backup-work instances at the same
......
#!/bin/bash
shopt -s extglob
for base in /lysrdiff/*/perm/lysrdiff
do
cd $base/backups || continue
for cat in *
do
(
cd "$cat" || continue
for subcat in *
do
fgrep "$cat $subcat " $base/tasks >/dev/null
if [ $? -eq 1 ]
then
echo $base $cat $subcat seems obsolete
ls -l $base/state/"$cat"-"$subcat"-+([a-z]) | sed 's/^/ /'
for otherbase in /lysrdiff/*/perm/lysrdiff
do
if [ $base != $otherbase ]
then
fgrep "$cat $subcat " $otherbase/tasks >/dev/null
if [ $? -eq 0 ]
then
echo ' found in '$otherbase:
echo -n ' '
ls -l $otherbase/state/"$cat-$subcat-end"
fi
fi
done
if [ -d $base/obsolete/backups/"$cat"/"$subcat" ]
then
echo ' ALREADY OBSOLETED!'
continue
fi
echo -n '[CONFIRM]'
read line
mkdir -p $base/obsolete/backups/"$cat"
mkdir -p $base/obsolete/state
mv $base/backups/"$cat"/"$subcat" \
$base/obsolete/backups/"$cat"/"$subcat"
mv $base/state/"$cat"-"$subcat"-+([a-z]) $base/obsolete/state
echo
fi
done
)
done
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment