汽车出口人才项目

Auto export talend project

我想每天在我的本地机器上导出我的 Talend 项目。我经常忘记手动执行此操作,如果有一种自动下载的方法,那将非常有帮助。有没有一种方法可以每天自动导出 Talend Open Studio 项目?

没有 built-in Talend 功能可以做到这一点,但由于 Talend 项目只是一个包含子文件夹和文件的目录,您可以设置一个 cron 作业来存档项目的主文件夹和副本它到另一个位置。
7zip 命令的示例:

Windows

7z.exe a -tzip /my/backup/folder/project.zip <TalendFolder>/workspace/PROJECT

Linux

7z a -tzip /my/backup/folder/project.zip <TalendFolder>/workspace/PROJECT

并通过 Windows 调度程序(或在 linux 上使用 cron 作业的 .sh)在 .bat 中安排此任务

如果您必须在硬盘驱动器上复制文件,以上代码可以正常工作。一旦有一个网络驱动器作为目标目录,代码就需要很长时间来处理 TOS 工作区内的数百万个小文件。

因此,我编写了以下脚本。 (请原谅其中的德语言论。) 它基于 7z 和 robocopy。

7z 应该只将 new/changed 文件添加到存档中,然后 robocopy 将存档推送到网络共享上的目标文件夹。

@echo off

echo.
echo --------------------------------
echo - start %date% %time% -
echo --------------------------------
echo.
echo.

REM choose working directory, where 7z should save the archive, before it is moved by robocopy
cd /D C:\Talend




REM define the name of your archive
set filename=TOS_DI_7.1_workspace_backup.7z

REM path of the directory, which should be put into the archive
set pathtobackup=C:\Talend\TOS_DI_7.1\workspace\

REM target path where the archive should be copied to
set destination=U:\Documents\TOS_DI_7.1\Backup\workspace


echo.
echo -------------------------------
echo - definition of the variables -
echo -------------------------------
echo.
echo This script creates an archive of the Talend Open Studio Workspace directory and copies it to the defined (network) directory.

echo current working direcotry:           %cd%
echo directory which is to be archived:   %pathtobackup%
echo name of the archive:                 %filename%
echo target directory:                    %destination%
echo directory for log files of robocopy: U:\Documents\TOS_DI_7.1\Backup\log\

REM please change log-directory below



echo.
echo.
echo --------------------------
echo - Start creating archive -
echo --------------------------
echo.
echo.

REM creation of archive
"C:\Program Files-Zipz.exe" u -up0q0r2x2y2z1w2 -t7z %filename% %pathtobackup%

echo.
echo ---------------------------------
echo - creation of archive completed -
echo ---------------------------------
echo.
echo.
echo.
echo -----------------
echo - Start copying -
echo -----------------
echo.
echo.    


REM robocopy copies the archive to the target directory
REM please change directory for log files here
robocopy %cd% %destination% %filename% /TEE/LOG+:"U:\Documents\TOS_DI_7.1\Backup\log\%date:~6,4%%date:~3,2%%date:~0,2%_%time:~0,2%%time:~3,2%%time:~6,2%_log.txt"


echo.
echo -------------------------------
echo - end %date% %time% -
echo -------------------------------
echo.
echo.


pause