Guest User

Untitled

a guest
Jan 27th, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. [root@noc iz]# cat /opt/noc/scripts/backup.sh
  2. #!/bin/sh
  3. cd /opt/noc
  4.  
  5. BACKUP_DIR='/var/tftp/backup/noc'
  6. DATE=`date +%Y-%m-%d`
  7. BACKUP_FILE=noc_backup-$DATE.tar.gz
  8.  
  9.  
  10. ./noc csv-export main.style > $BACKUP_DIR/main_style.csv
  11. ./noc csv-export ip.vrf > $BACKUP_DIR/ip_vrf.csv
  12. ./noc csv-export ip.address > $BACKUP_DIR/ip_address.csv
  13. ./noc csv-export ip.prefix > $BACKUP_DIR/ip_prefix.csv
  14. ./noc csv-export sa.managedobject > $BACKUP_DIR/sa_managedobject.csv
  15. ./noc csv-export sa.managedobjectprofiles > $BACKUP_DIR/sa_managedobjectprofiles.csv
  16.  
  17. cd $BACKUP_DIR
  18. tar -zcvf $BACKUP_FILE *.csv
  19. chown ftp:everybody $BACKUP_FILE
  20. rm -f *.csv
Advertisement
Add Comment
Please, Sign In to add comment