File: dates-restore.sh

package info (click to toggle)
dates 0.4.8-3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 3,072 kB
  • sloc: sh: 10,234; ansic: 10,012; makefile: 120
file content (27 lines) | stat: -rw-r--r-- 458 bytes parent folder | download | duplicates (3)
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
#!/bin/bash

if [ $# != 1 ]; then
  echo "requires one argument, a file with list of restored files"
  exit 1
fi

RESTORE_LIST=$1
if ! [ -e $RESTORE_LIST ]; then
  echo "no restore file found"
  exit 1
fi

if ! [ -d $HOME/.evolution/calendar ]; then
  echo "no $HOME/.evolution/calendar directory found"
  exit 1
fi

exec 2>/dev/null

for file in `find $HOME/.evolution/calendar`; do
  if ! grep "$file" $RESTORE_LIST; then
    rm -f $file
  fi
done

exit 0