The batch script under window is as follows:
REM@echo offREMGets the current date string for/F "tokens=1,2,3 delims=/-"%%a in ("%date%") Do@SetD=%%a%%b%%cEcho%d%Setlog=%d%.LogSetbackup_dmp=bbtj%d%.DMPSetbackup_log=bbtj%d%.Log(REMToggle Drive LetterE:REMSwitch DirectoriesCDE:\bbtj_backup\BBTJEcho%backup_dmp%Echo%BACKUP_LOG%EXPDP BBTJ/BBTJ schemas=bbtj directory=bbtj_dir dumpfile=%backup_dmp% logfile=%backup_log% compression=allpscp-i E:\BBTJ_BACKUP\WIN170PRIV.PPK%backup_dmp% [Email protected]:/data/remote_backup/backup170pscp-i E:\BBTJ_BACKUP\WIN170PRIV.PPK%backup_log% [Email protected]:/data/remote_backup/Backup170forfiles/P "E:\BBTJ_BACKUP\BBTJ"/s/m * */d-3/* "cmd/c echo @path"forfiles/P "E:\BBTJ_BACKUP\BBTJ"/s/m *. */d-3/C "cmd/c del @path") >e:\bbtj_backup\log\%log% 2>&1
Note: The SET command in the batch script is placed outside the (), otherwise the execution will be error when added to the scheduled task!!!
Password-free transmission to the machine using the PSCP Puttygen, the specific configuration see document: Windows password-free file to LINUX-PSCP
EXPDP scheduled backup of Oracle database under window