]> git.llucax.com Git - mecon/scripts.git/commitdiff
Se arregla la carga de datos del codep.
authorMatías Sklar <msklar@mecon.gov.ar>
Wed, 23 Jul 2003 18:00:43 +0000 (18:00 +0000)
committerMatías Sklar <msklar@mecon.gov.ar>
Wed, 23 Jul 2003 18:00:43 +0000 (18:00 +0000)
13 files changed:
novedades/cargas/1.localhost/carga [new file with mode: 0755]
novedades/cargas/1.localhost/scripts/10-borrar-codep [moved from novedades/cargas/intranet2.mecon.ar/scripts/10-borrar-codep with 61% similarity]
novedades/cargas/1.localhost/scripts/20-codep [moved from novedades/cargas/intranet-db.mecon.ar/scripts/40-codep with 79% similarity]
novedades/cargas/bal747f.mecon.ar/scripts/10-borrar-codep [deleted file]
novedades/cargas/bal747f.mecon.ar/scripts/20-copiar-datos
novedades/cargas/bal747f.mecon.ar/scripts/40-codep [deleted file]
novedades/cargas/bal747f.mecon.ar/scripts/60-copiar-codep [deleted file]
novedades/cargas/intranet-db.mecon.ar/scripts/10-borrar-codep [deleted file]
novedades/cargas/intranet-db.mecon.ar/scripts/20-copiar-datos
novedades/cargas/intranet-db.mecon.ar/scripts/60-copiar-codep [deleted file]
novedades/cargas/intranet2.mecon.ar/scripts/20-copiar-datos
novedades/cargas/intranet2.mecon.ar/scripts/40-codep [deleted file]
novedades/cargas/intranet2.mecon.ar/scripts/60-copiar-codep [deleted file]

diff --git a/novedades/cargas/1.localhost/carga b/novedades/cargas/1.localhost/carga
new file mode 100755 (executable)
index 0000000..938b226
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Script para cargar bases de datos.
+#
+# Creado por Leandro Lucarella (llucar) el mié ene 22 17:57:00 ART 2003
+#
+
+# Configuración.
+home="$1"
+datos="$2"
+host="intranet-db.mecon.ar"
+user="intranet"
+pass="intranet"
+db="CODEP"
+
+# Script.
+/bin/run-parts \
+    --lsbsysinit \
+    --verbose \
+    --arg="$host" \
+    --arg="$user" \
+    --arg="$pass" \
+    --arg="$db" \
+    --arg="$home" \
+    --arg="$datos" \
+    "$home/scripts"
similarity index 61%
rename from novedades/cargas/intranet2.mecon.ar/scripts/10-borrar-codep
rename to novedades/cargas/1.localhost/scripts/10-borrar-codep
index 027807b2d6a523739d97463a594733f6bb072fe6..affbf9956dc764ea149a5ec59d00de6f79b9c505 100755 (executable)
@@ -6,4 +6,4 @@ db="$4"
 home="$5"
 datos="$6"
 
 home="$5"
 datos="$6"
 
-ssh novedades@"$host" rm -vf "$datos"/codep
+rm -vf "$datos"/codep
similarity index 79%
rename from novedades/cargas/intranet-db.mecon.ar/scripts/40-codep
rename to novedades/cargas/1.localhost/scripts/20-codep
index d7be87a1f5eb88b96d6816485c1ed33bd9bc7a0d..eb449762fd54c5d4fcb6c33530cccbeb032fcc32 100755 (executable)
@@ -2,8 +2,7 @@
 host="$1"
 user="$2"
 pass="$3"
 host="$1"
 user="$2"
 pass="$3"
-#db="$4"
-db="CODEP"
+db="$4"
 home="$5"
 datos="$6"
 
 home="$5"
 datos="$6"
 
@@ -17,5 +16,7 @@ FIELDS TERMINATED BY
 LINES TERMINATED BY
     '\n'
 FROM
 LINES TERMINATED BY
     '\n'
 FROM
-    Dependencias;
+    Dependencias
+WHERE
+    dependencia_esta_activa = 1;
 EOT
 EOT
diff --git a/novedades/cargas/bal747f.mecon.ar/scripts/10-borrar-codep b/novedades/cargas/bal747f.mecon.ar/scripts/10-borrar-codep
deleted file mode 100755 (executable)
index 772b034..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-host="$1"
-user="$2"
-pass="$3"
-db="$4"
-home="$5"
-datos="$6"
-
-ssh -1 novedades@"$host" rm -vf "$datos"/codep
index 64d86e0aa4b807f04feaccdf43ac48c705cbaea7..3255b354ff9ccd647caa1d681c78df8a5110e1e7 100755 (executable)
@@ -7,5 +7,5 @@ home="$5"
 datos="$6"
 
 scp -1 -vr "$datos"/* novedades@"$host":"$datos"
 datos="$6"
 
 scp -1 -vr "$datos"/* novedades@"$host":"$datos"
-ssh -1 novedades@"$host" chmod -v  775 "$datos"
-ssh -1 novedades@"$host" chmod -vR 664 "$datos"/*
+ssh -1 -n novedades@"$host" chmod -v  775 "$datos"
+ssh -1 -n novedades@"$host" chmod -vR 664 "$datos"/*
diff --git a/novedades/cargas/bal747f.mecon.ar/scripts/40-codep b/novedades/cargas/bal747f.mecon.ar/scripts/40-codep
deleted file mode 100755 (executable)
index d7be87a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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/bal747f.mecon.ar/scripts/60-copiar-codep b/novedades/cargas/bal747f.mecon.ar/scripts/60-copiar-codep
deleted file mode 100755 (executable)
index 4150b8a..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-host="$1"
-user="$2"
-pass="$3"
-db="$4"
-home="$5"
-datos="$6"
-
-scp -1 -r novedades@"$host":"$datos"/codep "$datos"
diff --git a/novedades/cargas/intranet-db.mecon.ar/scripts/10-borrar-codep b/novedades/cargas/intranet-db.mecon.ar/scripts/10-borrar-codep
deleted file mode 100755 (executable)
index 772b034..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-host="$1"
-user="$2"
-pass="$3"
-db="$4"
-home="$5"
-datos="$6"
-
-ssh -1 novedades@"$host" rm -vf "$datos"/codep
index 64d86e0aa4b807f04feaccdf43ac48c705cbaea7..3255b354ff9ccd647caa1d681c78df8a5110e1e7 100755 (executable)
@@ -7,5 +7,5 @@ home="$5"
 datos="$6"
 
 scp -1 -vr "$datos"/* novedades@"$host":"$datos"
 datos="$6"
 
 scp -1 -vr "$datos"/* novedades@"$host":"$datos"
-ssh -1 novedades@"$host" chmod -v  775 "$datos"
-ssh -1 novedades@"$host" chmod -vR 664 "$datos"/*
+ssh -1 -n novedades@"$host" chmod -v  775 "$datos"
+ssh -1 -n novedades@"$host" chmod -vR 664 "$datos"/*
diff --git a/novedades/cargas/intranet-db.mecon.ar/scripts/60-copiar-codep b/novedades/cargas/intranet-db.mecon.ar/scripts/60-copiar-codep
deleted file mode 100755 (executable)
index 4150b8a..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-host="$1"
-user="$2"
-pass="$3"
-db="$4"
-home="$5"
-datos="$6"
-
-scp -1 -r novedades@"$host":"$datos"/codep "$datos"
index 4b26ca77af6d3a72831d3bec71998a31a6f9486c..d3d536a6beb50021608bcc0f78d835f95576086f 100755 (executable)
@@ -7,5 +7,5 @@ home="$5"
 datos="$6"
 
 scp -r "$datos"/* novedades@"$host":"$datos"
 datos="$6"
 
 scp -r "$datos"/* novedades@"$host":"$datos"
-ssh novedades@"$host" chmod -v  775 "$datos"
-ssh novedades@"$host" chmod -vR 664 "$datos"/*
+ssh -1 -n novedades@"$host" chmod -v  775 "$datos"
+ssh -1 -n 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
deleted file mode 100755 (executable)
index d7be87a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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/60-copiar-codep b/novedades/cargas/intranet2.mecon.ar/scripts/60-copiar-codep
deleted file mode 100755 (executable)
index ff18f7f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-host="$1"
-user="$2"
-pass="$3"
-db="$4"
-home="$5"
-datos="$6"
-
-scp -r novedades@"$host":"$datos"/codep "$datos"