juanesech
3/2/2017 - 1:53 PM

Verifymount_&_copytoserver.sh

#! /bin/bash
mnt=`mount |grep /mnt/backups`
if [[ -z "$mnt" ]]; then
  echo "Mounting cifs on /mnt/backups: "
  mount -t cifs //10.241.2.61/e$/JBOSS/$HOSTNAME -o user=ginexshp,pass=sysshp,dom=ACHS /mnt/backups
  cp -n /root/shell/backup/*.tar.gz /mnt/backups &
  echo "Copy started in background"
else
  echo "cifs already mounted"
  cp -n /root/shell/backup/*.tar.gz /mnt/backups &
  echo "Copy started in background"
fi