scan 472 B

123456789101112131415161718
  1. #!/bin/rc
  2. rfork en
  3. fn usage {
  4. echo 'usage: replica/scan replica-name [paths]' >[1=2]
  5. exit usage
  6. }
  7. . /rc/bin/replica/defs $*
  8. need serverroot serverexclude serverproto serverdb serverlog
  9. must servermount
  10. replica/updatedb -r^$serverroot $serverexclude -p^$serverproto $serverdb >>$serverlog
  11. ndb=`{echo $serverdb | sed 's;(.*)/(.*);\1/n\2;'}
  12. odb=`{echo $serverdb | sed 's;(.*)/(.*);\1/_\2;'}
  13. replica/compactdb $serverdb >$ndb && mv $serverdb $odb && mv $ndb $serverdb