As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
:begin move c:\Watchdog\Upload\* c:\temporales ftp -v -i -s:ftpcmd.txt del /Q c:\temporales\*.* ping 1.1.1.1 -n 1 -w 10000 goto begin
open localhost admin admin !:— FTP commands below here — lcd c:/temporales cd Alfresco binary mput "*.*" bye
#!/bin/bash FICHERO=prueba.txt curl -u admin:admin -T $FICHERO ftp://localhost:1121/Alfresco/$FICHERO >/dev/null 2>&1 if [ $? -eq 0 ]; then echo "El fichero se ha subido correctamente." else echo "ERROR en la subida del fichero." fi
Muchas gracias, no sabia que existian aplicaciones que hicieran esto
Cesarista, yo prefiero en principio curl por razones de eficiencia y mayor control:http://daniel.haxx.se/docs/curl-vs-wget.htmlUn saludo.
# Log script output LOGTO("C:\transfer_log.txt",APPEND) $result=OPENHOST("localhost","admin","admin") # Stop the script execution if not connected IF($result!="OK") STOP END IF # Change current local directory to c:\mytempdir $result=LOCALCHDIR("c:\temporales") # Stop the script execution if could not # change the current local directory IF($result!="OK") STOP END IF # Change the current remote directory to # /destination_remote_dir/ $result=CHDIR("/Alfresco/") # Stop the script execution if could not # change the current remote directory IF($result!="OK") STOP END IF SETUPLOADMODE(DIRECT) # Obtiene una lista de elementos GETLIST($list,LOCAL_FILES,"*.*") # Por cada fichero en la lista $list… FOREACH $item IN $list # Copiamos el fichero por ftp $result=PUTFILE($item) # Si se ha movido correctamente borramos el fichero IF($result=="OK") print("Fichero copiado correctamente. Borrando fichero….".$item) $result = EXEC("del ".$item) IF($result!=0) IF($result==1) print("No se ha encontrado el fichero. Errorcode: ".$result) ELSE print("El borrado ha fallado. Errorcode: ".$result) exit(1969) END IF ELSE print("El fichero se ha borrado con exito") END IF ELSE print("Ha ocurrido un error moviendo el fichero ".$item) END IF END FOREACH CLOSEHOST SLEEP(30) goto :start