Skip to content

Instantly share code, notes, and snippets.

@andreagx
Created April 11, 2017 22:23
Show Gist options
  • Select an option

  • Save andreagx/917b920966111090ed60773b3e596a67 to your computer and use it in GitHub Desktop.

Select an option

Save andreagx/917b920966111090ed60773b3e596a67 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Purpose = Backup of Important Data
#Created on 17-1-2012
#Author = Andrea Gallazzi
#Version 1.0
#START
#TIME=`date +%b-%d-%y` # This Command will add date in Backup File Name if needed
#FILENAME=backupxyz.tar.gz # Backup file name format if needed
SRCDIR=/mnt/share # Data Directory location (Source of backup).
DESDIR=/mybackupfolder # Destination of backup file.
mount -t cifs //fn1v/am /mnt/finance -o credentials=/root/.cred,iocharset=utf8
mount -t cifs //fn1v/ala /mnt/ala -o credentials=/root/.cred,iocharset=utf8
mount -t cifs //fs1v/users /mnt/users -o credentials=/root/.cred,iocharset=utf8
mount -t cifs //fs1v/dataen /mnt/data -o credentials=/root/.cred,iocharset=utf8
#tar -cpzf $DESDIR/$FILENAME $SRCDIR
tar -cpzf /mnt/1tb_local/finance.tar.gz /mnt/finance
tar -cpzf /mnt/1tb_local/ala.tar.gz /mnt/ala
tar -cpzf /mnt/1tb_local/data.tar.gz /mnt/data
tar -cpzf /mnt/1tb_local/users.tar.gz /mnt/users
umount -f -a -t cifs -l
#END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment