UnixServerAdmin

Server Administration & Management

report-backup.sh

#############################################################
## report-backup.sh ##
#############################################################
## Script for Daily Backup Report of Servers ##
#############################################################
## Make a Directory /REPORTS ##
## Make a file msg.txt under /REPORTS Directory ##
## Write Folowing in msg.txt file ##
#############################################################
## Hi, ##
## The Daily Backup of All Servers have Done. ##
## The Daily Backup Report is attached with this mail. ##
## Thanks & Regards, ##
## Unixserveradmin.com Security Team ##
#############################################################
#!/bin/sh
set -x
set -v
standby=$1
BACKUPDIR=/datasrv/
BACKFILE1=`date ‘+%d-%b-%Y-‘`
BACKFILE2=`date –date=’yesterday’ ‘+%d-%b-%Y-‘`

/bin/echo ”      ” >> /REPORTS/Backup.log_$(date +%d%m%y).txt
/bin/echo “====================================” >> /REPORTS/Backup.log_$(date +%d%m%y).txt
/bin/echo “Daily Remote Backup Report of the Project on Today” >> /REPORTS/Backup.log_$(date +%d%m%y).txt
/bin/echo “====================================” >> /REPORTS/Backup.log_$(date +%d%m%y).txt
/bin/echo ”      ” >> /REPORTS/Backup.log_$(date +%d%m%y).txt
/usr/bin/du -hs /datasrv/*/*$BACKFILE1* >> /REPORTS/Backup.log_$(date +%d%m%y).txt
/bin/echo ”      ” >> /REPORTS/Backup.log_$(date +%d%m%y).txt

/bin/echo ”      ” >> /REPORTS/Backup.log_$(date +%d%m%y).txt
/bin/echo “====================================” >> /REPORTS/Backup.log_$(date +%d%m%y).txt
/bin/echo “Daily Remote Backup Report of UPSRTC Project on Yesterday” >> /REPORTS/Backup.log_$(date +%d%m%y).txt
/bin/echo “====================================” >> /REPORTS/Backup.log_$(date +%d%m%y).txt
/bin/echo ”      ” >> /REPORTS/Backup.log_$(date +%d%m%y).txt
/usr/bin/du -hs /datasrv/*/*$BACKFILE2* >> /REPORTS/Backup.log_$(date +%d%m%y).txt
/bin/echo ”      ” >> /REPORTS/Backup.log_$(date +%d%m%y).txt
/bin/echo “====================================” >> /REPORTS/Backup.log_$(date +%d%m%y).txt

mutt -s “Daily Remote Backup Report of the Project” -a /REPORTS/Backup.log_$(date +%d%m%y).txt — unixserv@unixserveradmin.com  info@unixserveradmin.com  < /REPORTS/msg.txt
###################################################################

February 20, 2014 Posted by | Shell Script | | Leave a comment

How to add Cluster or Node in Proxmox VE

There are three Clusters or Notes as Following :-

Cluster-1 or Node-1 :- 192.168.1.10
Cluster-2 or Node-2 :- 192.168.1.11
Cluster-3 or Node-3 :- 192.168.1.12

All settings can be done via command pvecm (Proxmox Virtual Environment cluster manager)

Step-1 :- Create the Master Cluster

Login via ssh to the first Proxmox VE node or cluster. Use a unique name for your Cluster, this name cannot be changed later.

node-1# pvecm create node-1

node-1# pvecm status (To check the state of cluster)

Step-2 :- Adding nodes to the Cluster

Login via ssh to the other Proxmox VE nodes. Please note, the node cannot hold any same VM´s. (If yes you will get conflicts with identical VMID´s – to workaround, use vzdump to backup and to restore to a different VMID after the cluster configuration).

node-2# pvecm add 192.168.1.10 (Add a node)

node-2# pvecm status (To check or display the state of cluster:)

Version: 6.2.0
Config Version: 2
Cluster Name: node-1
Cluster Id: 6639
Cluster Member: Yes
Cluster Generation: 8
Membership state: Cluster-Member
Nodes: 2
Expected votes: 2
Total votes: 2
Node votes: 1
Quorum: 2
Active subsystems: 5
Flags:
Ports Bound: 0
Node name: node-2
Node ID: 2
Multicast addresses: 239.192.25.9
Node addresses: 192.168.1.11

node-2# pvecm nodes (Display the nodes of cluster)

Node  Sts   Inc   Joined               Name
1   M    156   2013-09-05 10:39:09  node-1
2   M    156   2013-09-05 10:39:09  node-2
3   M    168   2013-09-05 11:24:12  node-3

node-1# pvecm delnode node-2 (Remove a cluster node)

February 10, 2014 Posted by | Proxmox, Virtualization | , , | 4 Comments