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
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
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 del usuario que entra por ssh.
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 ejecute automaticamente todos los dias, realizamos los siguientes pasos:
Abrimos: Administrador del Servidor – Configuracion – Programador de Tareas
Clic derecho, Crear Tarea Basica.
Damos, el nombre de la tarea, diariamente, la hora, Iniciar Programa, Escogemos nuestro script, Finalizar.
1- Instalar Servidor Ubuntu 16.04
2- Bajar los repositorios