pre-push 550 Bytes
Newer Older
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/sh
production_dir="production"
bkp_dir="uploaded"
#remote_dir="user@192.168.0.121:/path/"
remote_dir="."

echo "-------- $0: Archive --------"
cd $production_dir
../archive_stp_dxf_pdf_any_year.sh

#back up files
echo "-------- $0: Back Up --------"
if [ ! -d $bkp_dir ]; then mkdir $bkp_dir; fi
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
14
for f in *.stp *.dxf *.igs *.dwb *.bmp *.png *.jpg *.pdf~; 
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
15 16 17 18 19 20 21
do 
  if [ -f $f ]; then mv $f $bkp_dir; fi
done

for f in *.pdf; do cp $f $bkp_dir; done

echo "-------- $0: Upload --------"
22
rsync --ignore-existing -a -f '- /*/' . $remote_dir
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
23 24

exit 0