Script automation problem

Advertisement

nagibmelo
Joined:
Posts:
4
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:
4
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:
4
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:
4
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 immedietly 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

You can post new topics in this forum