]> git.llucax.com Git - mecon/scripts.git/commitdiff
Se agrega la carga de novedades para intranet2.
authorLeandro Lucarella <llucax@gmail.com>
Wed, 16 Apr 2003 19:36:47 +0000 (19:36 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Wed, 16 Apr 2003 19:36:47 +0000 (19:36 +0000)
novedades/cargas/intranet2.mecon.ar/carga [new file with mode: 0755]
novedades/cargas/intranet2.mecon.ar/scripts/10.borrar.codep [new file with mode: 0755]
novedades/cargas/intranet2.mecon.ar/scripts/20.copiar.datos [new file with mode: 0755]
novedades/cargas/intranet2.mecon.ar/scripts/40.codep [new file with mode: 0755]
novedades/cargas/intranet2.mecon.ar/scripts/50.novedades [new file with mode: 0755]
novedades/cargas/intranet2.mecon.ar/scripts/60.copiar.codep [new file with mode: 0755]

diff --git a/novedades/cargas/intranet2.mecon.ar/carga b/novedades/cargas/intranet2.mecon.ar/carga
new file mode 100755 (executable)
index 0000000..1df396b
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# Script para cargar bases de datos.
+#
+# Creado por Leandro Lucarella (llucar) el miĆ© abr 16 14:00:46 ART 2003
+#
+
+# ConfiguraciĆ³n.
+home="$1"
+datos="$2"
+host="intranet2"
+user="intranet"
+pass="intranet"
+db="novedades"
+
+# Script.
+/bin/run-parts \
+    --verbose \
+    --arg="$host" \
+    --arg="$user" \
+    --arg="$pass" \
+    --arg="$db" \
+    --arg="$home" \
+    --arg="$datos" \
+    "$home/scripts"
diff --git a/novedades/cargas/intranet2.mecon.ar/scripts/10.borrar.codep b/novedades/cargas/intranet2.mecon.ar/scripts/10.borrar.codep
new file mode 100755 (executable)
index 0000000..027807b
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+host="$1"
+user="$2"
+pass="$3"
+db="$4"
+home="$5"
+datos="$6"
+
+ssh novedades@"$host" rm -vf "$datos"/codep
diff --git a/novedades/cargas/intranet2.mecon.ar/scripts/20.copiar.datos b/novedades/cargas/intranet2.mecon.ar/scripts/20.copiar.datos
new file mode 100755 (executable)
index 0000000..4b26ca7
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+host="$1"
+user="$2"
+pass="$3"
+db="$4"
+home="$5"
+datos="$6"
+
+scp -r "$datos"/* novedades@"$host":"$datos"
+ssh novedades@"$host" chmod -v  775 "$datos"
+ssh novedades@"$host" chmod -vR 664 "$datos"/*
diff --git a/novedades/cargas/intranet2.mecon.ar/scripts/40.codep b/novedades/cargas/intranet2.mecon.ar/scripts/40.codep
new file mode 100755 (executable)
index 0000000..d7be87a
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+host="$1"
+user="$2"
+pass="$3"
+#db="$4"
+db="CODEP"
+home="$5"
+datos="$6"
+
+cat <<EOT | mysql -h"$host" -u"$user" -p"$pass" "$db"
+SELECT
+    codigo_actual, nombre_breve
+INTO OUTFILE
+    '$datos/codep'
+FIELDS TERMINATED BY
+    ','
+LINES TERMINATED BY
+    '\n'
+FROM
+    Dependencias;
+EOT
diff --git a/novedades/cargas/intranet2.mecon.ar/scripts/50.novedades b/novedades/cargas/intranet2.mecon.ar/scripts/50.novedades
new file mode 100755 (executable)
index 0000000..4655d8f
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+host="$1"
+user="$2"
+pass="$3"
+db="$4"
+home="$5"
+datos="$6"
+
+"$home/../../run-sql-data-parts" "$host" "$user" "$pass" "$db" "$datos"
diff --git a/novedades/cargas/intranet2.mecon.ar/scripts/60.copiar.codep b/novedades/cargas/intranet2.mecon.ar/scripts/60.copiar.codep
new file mode 100755 (executable)
index 0000000..ff18f7f
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+host="$1"
+user="$2"
+pass="$3"
+db="$4"
+home="$5"
+datos="$6"
+
+scp -r novedades@"$host":"$datos"/codep "$datos"