⇤ ← Revision 1 as of 2013-07-11 19:43:24
Size: 408
Comment:
|
Size: 1124
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
Line 6: | Line 7: |
mount -t cifs -o userx,passwordx //<servername>/<sharename> /mnt/point/ | yum install cifs-utils mount -t cifs -o username=userx,password=passwordx //<servername>/<sharename> /mnt/point/ |
Line 13: | Line 15: |
== Backup all files == File backup.sh: {{{#!highlight bash #!/bin/bash logfile=/mnt/point/backups`date '+%F'`.log datex=`date '+%FT%T'` hostx=`hostname` backfile=/mnt/point/"$hostx"_backup.tar.gz echo "$datex $hostx Log file: $logfile" >> $logfile echo "$datex $hostx Executing backup on /mnt/point" >> $logfile cd / rm $backfile echo "$datex $hostx Removed $backfile" >> $logfile tar cpzf $backfile --exclude=/proc --exclude=/dev --exclude=/media --exclude=/mnt --exclude=/lost+found / >> $logfile datex=`date '+%FT%T'` echo "$datex $hostx Ended backup on /mnt/point" >> $logfile }}} Add a crontab entry like '''@daily /home/userx/backup.sh'''. |
Samba share
Mount samba share on CentOS 6.3
Adapted from http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-samba-connect-share.html
Add entry to /etc/fstab:
1 //<servername>/<sharename> /mnt/point/ cifs username=userx,password=passwordx,_netdev 0 0
Backup all files
File backup.sh:
1 #!/bin/bash
2 logfile=/mnt/point/backups`date '+%F'`.log
3 datex=`date '+%FT%T'`
4 hostx=`hostname`
5 backfile=/mnt/point/"$hostx"_backup.tar.gz
6
7 echo "$datex $hostx Log file: $logfile" >> $logfile
8 echo "$datex $hostx Executing backup on /mnt/point" >> $logfile
9 cd /
10 rm $backfile
11 echo "$datex $hostx Removed $backfile" >> $logfile
12 tar cpzf $backfile --exclude=/proc --exclude=/dev --exclude=/media --exclude=/mnt --exclude=/lost+found / >> $logfile
13 datex=`date '+%FT%T'`
14 echo "$datex $hostx Ended backup on /mnt/point" >> $logfile
Add a crontab entry like @daily /home/userx/backup.sh.