Script automation problem

Advertisement

nagibmelo
Joined:
Posts:
5
Location:
Belem - Brasil

Script automation problem

So, my syntax works manually in the winscp WinSCP , but whenever I run the batch file, I get the error 3 code. Can I get some help?

Below the batch file:
@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\ETICA\Scripts\FTP\CHARLESlogWinSCP.log" /ini=nul ^
   /command ^
    "open sftp://sshd:xxxxxx@xxxxxx:3322/ -hostkey=""ssh-xxx xxxx xxxxxxxxxxxxxxxxxxxxxx""" ^
    "synchronize remote "E:\Arquivos Etica\Administrativo\CHARLES" "/mnt/HD/HD_c2/BKPETICA/Administrativo/CHARLES""
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit /b %WINSCP_RESULT%

Reply with quote E-mail

Advertisement

nagibmelo
Joined:
Posts:
5
Location:
Belem - Brasil

Scritp automotion problem

LOG FILE
. 2024-05-02 11:43:45.678 Startup conversation with host finished.
< 2024-05-02 11:43:45.678 Script: Sessão iniciada.
< 2024-05-02 11:43:45.679 Script: Sessão ativa: [1] sshd@cloud.tijet.com.br
> 2024-05-02 11:43:45.680 Script: synchronize remote E:\Arquivos
< 2024-05-02 11:43:45.680 Script: Comparando...
. 2024-05-02 11:43:45.681 Collecting synchronization list for local directory 'E:\Arquivos' and remote directory '/home/root', mode = Remote, params = 0x2 (NoConfirmation), file mask = ''
* 2024-05-02 11:43:45.681 (EOSExtException) Erro obtendo lista de arquivo para "E:\Arquivos\*.*".
* 2024-05-02 11:43:45.681 Erro de sistema. Código: 3
* 2024-05-02 11:43:45.681 O sistema não pode encontrar o caminho especificado
. 2024-05-02 11:43:45.681 Asking user:
. 2024-05-02 11:43:45.681 Erro ao listar diretório 'E:\Arquivos\*.*'. ("Erro obtendo lista de arquivo para ""E:\Arquivos\*.*"".","Erro de sistema. Código: 3","O sistema não pode encontrar o caminho especificado")
< 2024-05-02 11:43:45.681 Script: Erro ao listar diretório 'E:\Arquivos\*.*'.
< 2024-05-02 11:43:45.681 Script: Erro obtendo lista de arquivo para "E:\Arquivos\*.*".

Reply with quote E-mail

nagibmelo
Joined:
Posts:
5
Location:
Belem - Brasil

Scritp automotion problem

I have pemission to access, read and write.

I have tried changing the name of the directory to the OLD MS-DOS version as shown below:

E:\Arquivos Etica\Administrativo\CHARLES to E:\Arquiv~1\Administrativo\CHARLES

Reply with quote E-mail

nagibmelo
Joined:
Posts:
5
Location:
Belem - Brasil

This is a remote backup script, I am running this as a scheduled task WEEKLY ON saturdays and now I am getting code error 2 and the exit code 1 which ends the script immediately without finishing the sync command, how can I solve that ? Below is the LOG:
< 2024-05-16 12:39:37.547 Status code: 0
. 2024-05-16 12:39:37.547 Transfer done: 'E:\ArquivosEtica\Administrativo/\REGIS\BKP DOC\Meus documentos\Regis\LUCIANA PIANEGONDA\FOTOS\paty\DSC08059.JPG' => '/mnt/HD/HD_c2/BKPETICA/Administrativo/REGIS/BKP DOC/Meus documentos/Regis/LUCIANA PIANEGONDA/FOTOS/paty/DSC08059.JPG' [155770]
. 2024-05-16 12:39:37.547 Copying finished: Transferred: 591.305.458, Elapsed: 0:03:10, CPS: 3.110.104/s
. 2024-05-16 12:39:37.547 Copying 1 files/directories to remote directory "/mnt/HD/HD_c2/BKPETICA/Administrativo/REGIS/BKP DOC/Meus documentos/Regis/LUCIANA PIANEGONDA/FOTOS/paty/" - total size: 144.976
. 2024-05-16 12:39:37.547   PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask: *.*
. 2024-05-16 12:39:37.548   TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; EncryptNewFiles: Yes; ExcludeHiddenFiles: Yes; ExcludeEmptyDirectories: No; InclM: ; ResumeL: 0
. 2024-05-16 12:39:37.548   AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2024-05-16 12:39:37.548 File: 'E:\ArquivosEtica\Administrativo/\REGIS\BKP DOC\Meus documentos\Regis\LUCIANA PIANEGONDA\FOTOS\paty\DSC08084.JPG' [2078-01-19T18:25:20.000Z] [144976]
. 2024-05-16 12:39:37.548 Copying "E:\ArquivosEtica\Administrativo/\REGIS\BKP DOC\Meus documentos\Regis\LUCIANA PIANEGONDA\FOTOS\paty\DSC08084.JPG" to remote directory started.
. 2024-05-16 12:39:37.548 Binary transfer mode selected.
. 2024-05-16 12:39:37.548 Checking existence of file.
> 2024-05-16 12:39:37.548 Type: SSH_FXP_LSTAT, Size: 125, Number: 19876871
< 2024-05-16 12:39:37.556 Type: SSH_FXP_ATTRS, Size: 37, Number: 19876871
. 2024-05-16 12:39:37.557 File exists: DSC08084.JPG;-;144976;1941-12-14T11:57:04.000Z;4;"" [0];"" [0];rwxrwxrwx;1
. 2024-05-16 12:39:37.557 Checking existence of partially transferred file.
> 2024-05-16 12:39:37.557 Type: SSH_FXP_LSTAT, Size: 134, Number: 19877127
< 2024-05-16 12:39:37.567 Type: SSH_FXP_STATUS, Size: 29, Number: 19877127
< 2024-05-16 12:39:37.567 Status code: 2
. 2024-05-16 12:39:37.567 Opening remote file.
> 2024-05-16 12:39:37.567 Type: SSH_FXP_OPEN, Size: 150, Number: 19877379
< 2024-05-16 12:39:37.575 Type: SSH_FXP_HANDLE, Size: 13, Number: 19877379
> 2024-05-16 12:39:37.575 Type: SSH_FXP_WRITE, Size: 32761, Number: 19877894
. 2024-05-16 12:39:37.577 Skipped 4 SSH_FXP_WRITE packets
> 2024-05-16 12:39:37.577 Type: SSH_FXP_CLOSE, Size: 13, Number: 19879172
< 2024-05-16 12:39:37.597 Type: SSH_FXP_STATUS, Size: 24, Number: 19877894
< 2024-05-16 12:39:37.597 Status code: 0
. 2024-05-16 12:39:37.618 Skipped 4 SSH_FXP_STATUS packets
< 2024-05-16 12:39:37.618 Type: SSH_FXP_STATUS, Size: 24, Number: 19879172
< 2024-05-16 12:39:37.618 Status code: 0
> 2024-05-16 12:39:37.618 Type: SSH_FXP_REMOVE, Size: 125, Number: 19879437
< 2024-05-16 12:39:37.624 Type: SSH_FXP_STATUS, Size: 24, Number: 19879437
< 2024-05-16 12:39:37.624 Status code: 0
> 2024-05-16 12:39:37.624 Type: SSH_FXP_RENAME, Size: 254, Number: 19879698
< 2024-05-16 12:39:37.629 Type: SSH_FXP_STATUS, Size: 24, Number: 19879698
< 2024-05-16 12:39:37.629 Status code: 0
. 2024-05-16 12:39:37.629 Preserving timestamp [2078-01-19T18:25:20.000Z]
> 2024-05-16 12:39:37.629 Type: SSH_FXP_SETSTAT, Size: 141, Number: 19877641
< 2024-05-16 12:39:37.641 Type: SSH_FXP_STATUS, Size: 24, Number: 19877641
< 2024-05-16 12:39:37.641 Status code: 0
. 2024-05-16 12:39:37.641 Transfer done: 'E:\ArquivosEtica\Administrativo/\REGIS\BKP DOC\Meus documentos\Regis\LUCIANA PIANEGONDA\FOTOS\paty\DSC08084.JPG' => '/mnt/HD/HD_c2/BKPETICA/Administrativo/REGIS/BKP DOC/Meus documentos/Regis/LUCIANA PIANEGONDA/FOTOS/paty/DSC08084.JPG' [144976]
. 2024-05-16 12:39:37.642 Copying finished: Transferred: 591.450.434, Elapsed: 0:03:10, CPS: 3.109.313/s
. 2024-05-16 12:39:37.642 Script: Failed
. 2024-05-16 12:39:37.642 Script: Exit code: 1
. 2024-05-16 12:39:37.642 Closing connection.
. 2024-05-16 12:39:37.642 Sending special code: 1
. 2024-05-16 12:39:37.665 Session sent command exit status 0
. 2024-05-16 12:39:37.665 Main session channel closed
. 2024-05-16 12:39:37.666 All channels closed

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar

@nagibmelo: Please post complete log. There's no "code error 2" in the snippet you have posted. Also, there's no indication that the script ended prematurely. Why do you think so? What else did you expect to happen after the DSC08084.JPG finished transferring?

Reply with quote

nagibmelo
Joined:
Posts:
5
Location:
Belem - Brasil

it gives me the Status Code 2, and also a it says at 2024-05-16 12:39:37.642 Script: Failed, sometimes I get the code error 2 and sometimes the error code 123 like on the log below.
* 2024-05-20 11:21:25.017 A sintaxe do nome do arquivo, do nome do diretório ou do rótulo do volume está incorreta
. 2024-05-20 11:21:25.017 Asking user:
. 2024-05-20 11:21:25.017 Arquivo ou pasta 'E:\ArquivosEtica\ArquivoDigital\/\CONTRATOS\LOCACAO\VERBAS\CONTRATOS ASSINADOS\2022\12. DEZEMBRO\I-2440 BEABA INTERVENÇÃO COMPORTAMENTAL LTDA\BEM 9185 - BEABA Intervenção Comportamental (JAYME BONILHA JUNIOR)\SINTONIA COMERCIO\CT - 92-2022 - SINTONIA COMÉRCIO E SERVIÇOS AUTOMOTIVOS LTDA - DIGITALIZADO.pdf' não existe. ("Erro de sistema. Código: 123
 
. 2024-05-20 11:21:25.017 A sintaxe do nome do arquivo, do nome do diretório ou do rótulo do volume está incorreta")
< 2024-05-20 11:21:25.017 Script: Arquivo ou pasta 'E:\ArquivosEtica\ArquivoDigital\/\CONTRATOS\LOCACAO\VERBAS\CONTRATOS ASSINADOS\2022\12. DEZEMBRO\I-2440 BEABA INTERVENÇÃO COMPORTAMENTAL LTDA\BEM 9185 - BEABA Intervenção Comportamental (JAYME BONILHA JUNIOR)\SINTONIA COMERCIO\CT - 92-2022 - SINTONIA COMÉRCIO E SERVIÇOS AUTOMOTIVOS LTDA - DIGITALIZADO.pdf' não existe.
< 2024-05-20 11:21:25.018 Script: Erro de sistema. Código: 123
 
< 2024-05-20 11:21:25.018 A sintaxe do nome do arquivo, do nome do diretório ou do rótulo do volume está incorreta
. 2024-05-20 11:21:25.020 Answer: Abort
* 2024-05-20 11:21:25.020 (ESkipFile) Arquivo ou pasta 'E:\ArquivosEtica\ArquivoDigital\/\CONTRATOS\LOCACAO\VERBAS\CONTRATOS ASSINADOS\2022\12. DEZEMBRO\I-2440 BEABA INTERVENÇÃO COMPORTAMENTAL LTDA\BEM 9185 - BEABA Intervenção Comportamental (JAYME BONILHA JUNIOR)\SINTONIA COMERCIO\CT - 92-2022 - SINTONIA COMÉRCIO E SERVIÇOS AUTOMOTIVOS LTDA - DIGITALIZADO.pdf' não existe.
* 2024-05-20 11:21:25.020 Erro de sistema. Código: 123
* 2024-05-20 11:21:25.020 A sintaxe do nome do arquivo, do nome do diretório ou do rótulo do volume está incorreta
. 2024-05-20 11:21:25.020 Copying finished: Transferred: 286.772, Elapsed: 0:00:00, CPS: 1.924.644/s
. 2024-05-20 11:21:25.020 Script: Failed
. 2024-05-20 11:21:25.020 Script: Exit code: 1
. 2024-05-20 11:21:25.020 Closing connection.
. 2024-05-20 11:21:25.020 Sending special code: 1
. 2024-05-20 11:21:25.039 Session sent command exit status 0
. 2024-05-20 11:21:25.039 Main session channel closed
. 2024-05-20 11:21:25.040 All channels closed

Reply with quote E-mail

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

I've asked for complete log. Also English log would be much more useful.

In any case, the path E:\ArquivosEtica\ArquivoDigital\/\CONTRATOS\... seems wrong to me. And the error message "A sintaxe do nome do arquivo, do nome do diretório ou do rótulo do volume está incorreta" seems clear about that even to me and I do not speak Portuguese.

Reply with quote

Advertisement

You can post new topics in this forum