# Configuración.
home="$1"
datos="$2"
-host="localhost"
+host="bal747f"
user="intranet"
pass="intranet"
db="novedades"
--- /dev/null
+#!/bin/sh
+host="$1"
+user="$2"
+pass="$3"
+db="$4"
+home="$5"
+datos="$6"
+
+ssh -1 novedades@"$host" rm -vf "$datos"/codep
--- /dev/null
+#!/bin/sh
+host="$1"
+user="$2"
+pass="$3"
+db="$4"
+home="$5"
+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"/*
--- /dev/null
+#!/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
--- /dev/null
+#!/bin/sh
+host="$1"
+user="$2"
+pass="$3"
+db="$4"
+home="$5"
+datos="$6"
+
+scp -1 -r novedades@"$host":"$datos"/codep "$datos"