Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 495 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 495 Rev 1037
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
##############################################################################################################
2
##############################################################################################################
3
# But : téléchargement automatique en local des données des projets depuis le serveur de Tela Botanica par ftp
3
# But : téléchargement automatique en local des données des projets depuis le serveur de Tela Botanica par ftp
4
# Auteur :  Jean-Pascal Milcent <jpm@tela-botanica.org> (translate bat file to shell script) 
4
# Auteur :  Jean-Pascal Milcent <jpm@tela-botanica.org> (translate bat file to shell script)
5
# License : GPL v3
5
# License : GPL v3
6
# Création : 07 decembre 2011
6
# Création : 07 decembre 2011
7
# Version: 0.1
7
# Version: 0.1
-
 
8
# 2014-03-20 : changement dossier distant suite à passage sur Agathis.
8
# 2011-12-07 - Création
9
# 2011-12-07 : Création.
9
# $Id$
-
 
10
##############################################################################################################
10
##############################################################################################################
11
# Constante
11
# Constante
12
NBREPARAM=$#
12
NBREPARAM=$#
13
APPDIR_ABSOLU=`pwd`;
13
APPDIR_ABSOLU=`pwd`;
14
DOSSIER_LOCAL="$APPDIR_ABSOLU/donnees/"
14
DOSSIER_LOCAL="$APPDIR_ABSOLU/donnees/"
15
DOSSIER_DISTANT="/www/eflore/donnees/"
15
DOSSIER_DISTANT="/"
16
# Aide
16
# Aide
17
E_OPTERR=65
17
E_OPTERR=65
18
if [ "$1" = '--help' ]
18
if [ "$1" = '--help' ]
19
then # Le script a besoin d'au moins un argument sur la ligne de commande
19
then # Le script a besoin d'au moins un argument sur la ligne de commande
20
	echo "Usage $0 -[parameters -u, -p ]"
20
	echo "Usage $0 -[parameters -u, -p ]"
Line 36... Line 36...
36
		-u) FTP_USER=$2;;
36
		-u) FTP_USER=$2;;
37
		-p) FTP_PASSWD=$2;;
37
		-p) FTP_PASSWD=$2;;
38
		--) shift ; break ;;
38
		--) shift ; break ;;
39
		*) echo "Internal error!" ; exit 1 ;;
39
		*) echo "Internal error!" ; exit 1 ;;
40
	esac
40
	esac
41
	shift 2 
41
	shift 2
42
done
42
done
Line 43... Line 43...
43
 
43
 
44
# Transfert sur le serveur par FTP
44
# Transfert sur le serveur par FTP
45
if [ $NBREPARAM -eq 0 ]; then
45
if [ $NBREPARAM -eq 0 ]; then