#! /bin/csh -f

if ( "$#argv" < "1" ) then
  echo  usage: modif number_of_days
  exit
endif

find . \( -mtime -$1 -a ! -type d -a ! -name "*.o" -a ! -name "*.a" -a ! -name "*.bak" -a ! -name "*.tar*" -a ! -name "*~" -a ! -name "getdp" -a ! -name "getdp-*" \)

echo "archiver ? (y/s/n)"
set caca = "$<"

if ("$caca" == "y") then
  set liste = `find . \( -mtime -$1 -a ! -type d -a ! -name "*.o" -a ! -name "*.a" -a ! -name "*.bak" -a ! -name "*.tar*" -a ! -name "*~" -a ! -name "getdp" -a ! -name "getdp-*" \)`
  set date = `date "+%d.%m.%y-%Hh%M"`
  tar cvf modifs-getdp-$date.tar $liste
  gzip modifs-getdp-$date.tar
else if ("$caca" == "s") then
  set liste = `find . \( -mtime -$1 -a ! -type d -a ! -name "*.o" -a ! -name "*.a" -a ! -name "*.bak" -a ! -name "*.tar*" -a ! -name "*~" -a ! -name "getdp" -a ! -name "getdp-*" \)`
  ls -al $liste
else 
  echo "bye"
endif


