Backup Servidores Asterisk
Se realizan los siguientes pasos
Se realizan los siguientes pasos
Se deben seguir los siguientes pasos: Primero debemos ver la version del apache antes de continuar
1 2 3 |
apachectl -v Server version: Apache/2.2.3 Server built: Sep 16 2014 11:05:09 |
Si el comando anterior no nos funciona debemos utilizar:
1 |
apache2ctl -v |
1. Install prerequisites
1 |
yum install sendmail mailutils sendmail-bin |
2. Create Gmail Authentication file
1 2 |
mkdir -m 700 /etc/mail/authinfo/ cd /etc/mail/authinfo/ |
nano gmail-auth
1 |
AuthInfo: "U:root" "I:YOUR GMAIL EMAIL ADDRESS" "P:YOUR PASSWORD" |
Replace the above email with your gmail or google apps email. In the next step we will need to create a hash map for the above authentication file:
1 |
makemap hash gmail-auth < gmail-auth |
3. Configure your sendmail Put bellow lines
Entrar al servidor por ssh y borrar la configuracion anterior:
1 2 3 4 5 6 7 |
rm -rf /usr/local/etc/c-icap rm -rf /usr/local/include/c_icap rm -rf /usr/local/share/c_icap rm -rf /usr/local/lib/c_icap rm -rf /usr/local/etc/c-icap rm -rf /var/log/squid rm -rf /var/squid/ |
Volver a instalar el squid
Para ver cuantas conexiones tenemos activas
1 |
netstat -nat | awk '{print $6}' | sort | uniq -c | sort -n |
Se imprime algo asi: 1 established) 1 Foreign 3 FIN_WAIT2 5 LAST_ACK 6 CLOSING 9 SYN_RECV 10 ESTABLISHED 22 FIN_WAIT1 26 LISTEN 466 TIME_WAIT Para mirar la configuracion actual:
1 2 3 |
cat /proc/sys/net/ipv4/tcp_fin_timeout cat /proc/sys/net/ipv4/tcp_tw_recycle cat /proc/sys/net/ipv4/tcp_tw_reuse |
Los valores por defecto son:
Instalar paquetes necesarios
1 |
yum install glibc.i686 |
Bajar e instalar rpm de openfire
1 2 3 4 5 6 7 |
service openfire stop wget http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire-4.0.2-1.i386.rpm rpm -Uvf openfire-4.0.2-1.i386.rpm service openfire start |
Para ver errores al iniciar
1 |
tail -f nohup.out |
service openfire status Para probar si el java funciona
1 |
/opt/openfire/jre/bin/java |
NOTA: Se debe configurar que solo grabe 2 meses las conversaciones Si el openfire no sube despues
Se queremos saber cual es mi ip (externa). Ejecutamos los siguiente:
1 2 |
wget -qO- ifconfig.me/ip wget -qO- http://ipecho.net/plain |
Otra forma
1 2 |
curl ifconfig.me curl -s http://ipecho.net/plain |
Esto nos reemplaza el sitio cualesmiip Tambien podemos realizarlo se esta manera
1 |
curl https://ipinfo.io/ip |
Recordar añadir la ruta al servidor, si este no tiene default gateway
1 |
route add -host 216.239.32.21 gw 192.168.1.254 |
Listo.
Setup Samba Domain Controller with LDAP Backend in Ubuntu 13.04 | Unixmen Origen: Setup Samba Domain Controller with LDAP Backend in Ubuntu 13.04 | Unixmen Otro enlace https://wiki.samba.org/index.php/Samba_AD_DC_HOWTO
Si queremos grabar lo que hacemos en el term y ver la salida de nuestros comandos, utilizaremos el comando script. Primero editamos /etc/bashrc y al final agregamos la siguiente linea
1 2 |
test "$(ps -ocommand= -p $PPID | awk '{print $1}')" == 'script' || (script -f /t mp/ssh-$(date +"%d-%b-%y_%H-%M-%S")_shell.log) |
En la carpera /tmp veremos todo lo realizado. Con esto tenemos la grabacion de la pantalla
Se debe crear un archivo llamado SQLBackups.sql
1 2 3 4 5 6 7 8 9 10 |
BACKUP DATABASE Integrado_UDP TO DISK = N'D:\BACKUP-SQL\Integrado_UDP.bak' WITH NOFORMAT, INIT, NAME = N'MyDataBase1 Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 BACKUP DATABASE Integrado_Marketing TO DISK = N'D:\BACKUP-SQL\Integrado_Marketing.bak' WITH NOFORMAT, INIT, NAME = N'MyDataBase2 Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 BACKUP DATABASE Integrado_Antonio TO DISK = N'D:\BACKUP-SQL\Integrado_Antonio.bak' WITH NOFORMAT, INIT, NAME = N'MyDataBase2 Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO |
En el indicamos las bases de datos que queremos sabar Backup y la ubicacion del archivo .bak Despues creamos un archivo llamada backup.bat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
"C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\SQLCMD.EXE" -S SRVSQLDMS\SQLEXPRESS -i D:\SQLBackups.sql for /f %%x in ('wmic path win32_localtime get /format:list ^| findstr "="') do set %%x set mydate=%Year%-%Month%-%Day% "C:\7-Zip\7z.exe" a D:\BACKUP-SQL\SQL-DMS-%mydate%.zip D:\*.bak xcopy D:\BACKUP-SQL\SQL-DMS-%mydate%.zip D:\BACKUP-SQL\SQL-DMS-ULTIMO.zip /Y net use "\\10.25.50.9\nas" win2011 /user:win2011 :copy xcopy D:\BACKUP-SQL\SQL-DMS-%mydate%.zip "\\10.25.50.9\nas\" /Y xcopy D:\BACKUP-SQL\SQL-DMS-ULTIMO.zip "\\10.25.50.9\nas\" /Y IF ERRORLEVEL 0 goto disconnect goto end :disconnect net use "\\10.25.50.9\nas" /delete goto end :end |
Para comprimir nuestro backup debemos tener instalado el 7-Zip. Para que la tarea se