Pentaho Kettle - FTP Download(check if file download is complete) - ftp

I am not understanding how to implement this in Linux based systems. I have job which downloads the files from FTP and places it in local systems and my other job(has to run in parallel) has to check if the file is completely downloaded and then only process the file(transform) and emit the results. I am not able to check if the file is completely downloaded or not from the server. Any inputs??

Check the docs on the Check files locked job step. See if that will work for you.

Related

How to programmatically download many large files from dropbox

The National Speech Corpus is a Natural Language Processing corpus of Singaporean's speaking English, which can be found here: https://www.imda.gov.sg/programme-listing/digital-services-lab/national-speech-corpus.
When you sign up for the free corpus, you are directed to a dropbox folder. The corpus is 1 TB and (as of this writing) has four parts. I only wanted to download PART 1 but even this has 1446 zip files that are each quite larger. My question is: how do I programmatically download many large files from dropbox onto a Linux (Ubunut 16.04) VM using only the command line.
The directory tree for the relevant part looks like:
root
|-LEXICON
|-PART1
|-DATA
|-CHANNEL0
|-WAVE
|-SPEAKER0001.zip
|-SPEAKER0002.zip
...
|-SPEAKER1446.zip
I looked into a few different approaches:
Downloading the WAVE parent directory using a shared link via the wget command as described in this question. However, this didn't work as I received this error:
Reusing existing connection to www.dropbox.com:443
HTTP request sent, awaiting response... 400 Bad Request
2021-01-06 23:09:06 ERROR 400: Bad Request.
I assumed this was because the WAVE directory was too large for Dropbox to zip.
Based on this post, it was suggested that I could download the HTML of the WAVE parent directory and find all of the direct links to the individual zip files but the direct links to the individual files were not in the HTML file.
Based on the same post as in (2), I could also try to create shared links for each zip file using the dropbox API, though this seemed too cumbersome.
Download the Linux dropbox client and sync the relevant files as outlined in this installation.
In the end, the 4th option did work for me, but I wanted to post this investigation for anyone who needs to download this dataset in the future. Also, I wanted to see if anyone else had better approaches.
As I described, the approach that worked for me was to use Dropbox's linux client to sync the files on to my Linux VM. You can follow these instructions to download the Linux client. These instructions worked for me on my Ubuntu 16.04 VM.
One issue I encounter with the sync client was how to selectively exclude directories. I only had 630 GB on my VM and the entire National Speech Corpus size is 1TB, so I needed to exclude files before the Dropbox sync filled up my disk.
You can selectively exclude files using the dropbox python script that is at the bottom of the installation page. A link to the script is here. Calling the python script from my home directory (where the Dropbox sync folder is automatically installed) worked using the command:
python dropbox.py exclude add ~/Dropbox/<path_to_excluded_dir>
You may want to stop and start the dropbox client which can be done through:
python dropbox.py start
python dropbox.py stop
Finally, see the command in the python script for more information:
python dropbox.py --help
With this approach, I was able to easily download the desired files without overwhelming my VM.

How to download full file from FTP using talend openstudio

I am currently using talend open studio to download files from ftp to local machine. This is a scheduled task. Some times I am not able to download full files from FTP since at the same time files are being uploading to ftp.
Is there any way to check file fully uploaded to FTP and download using talend ?
In similar situation we check last modified time before downloading, let say donwload only 5mn old files. This can be done using tFTPFileProperties.

SSIS FTP Task - Downloading source files approach

Im to develop a SSIS package that have to download a list of files from a FTP location.Although the frequency and timings of retrieving the generated files have been agreed upon with the client .
I noticed many times that when connecting , the user files (CSV) are being created (size gradually increasing) and that those downloaded are partially complete in content.
One suggestion i received was to have a "check file" a file which would be created and the end of the files creation by the client which would inform me that the file are ready to be downloaded,should it not be found no download shall happen.
However, i would like to know if other options are available ,which can be integrated in SSIS.
Thanks
I would follow the 'check file' pattern. I would not introduce a new communications mode (e.g. email) which implies further complexity and configuration.
Lately for FTP tasks I have been calling WinSCP rather than using the SSIS FTP Task. It has better functionality. Here's their info on this topic:
http://winscp.net/eng/docs/script_checking_file_existence

How do I unzip remotely during the automated deployment to our QA environment?

I'm trying to figure out a way to automate the deployment to our QA environment. The problem is that our release is quite big, so needs to be Zipped, FTP'd and then Unzipped on the QA server. I'm not sure how best to unzip remotely.
I can think of a few options, but none of them sound right:
Use PsExec to execute a remote commandline call on the QA server to unzip the release.
Host a web service on the QA server that unzips the release and copies it to the right place. This service can be called by our release when it's done uploading the files.
Host a windows service on the QA server that monitors a file location and does the unzipping.
None of these are pretty though. I wonder how others have solved this problem?
PS: we use CruiseControl.NET to execute a NAnt script that does the building, zipping and FTP.
Instead of compressing and un-compressing, you can use a tool like rsync; which can transparently compress data during file transfer. The -z option tells rsync to use compression.
But I assume you are in a Windows environment, in which case you could use cwRsync (which is "rsync for Windows").
Depending on your access to the QA box this might not be a viable solution. You'll need to:
install the cwRsync server on the remote machine and
allow the traffic through any firewalls.
At the last place I worked at, we had a guy write a Windows service on the CI box to do the unzipping. TFS Team Server finished the build and notified a service to zip the completed build and copy it to the CI box. The CI box picked up on the new file, and unzipped it. It may have been a bit heavy, but it worked well - and he was cognizant to log all actions to the event log, so it was easy to diagnose if a server had been reset and the service hadn't started.
Update: One thing that we would have liked to improve on that process was to have the service on the CI box check for zip files and uncompressed files that were older than x months, for purging purposes. We routinely ran out of disk space (it was a VM that we rarely looked at), and had to manually purge old builds when it happened.

Script to execute on CVS check-in, without access to the server?

Is it possible to write a script that executes certain instructions, and is triggered by any check-in to a CVS repository?
The script would scan the list of files in the change-set and do a copy operation on certain files in a certain sub-directory.
I would hopefully be able to execute various console applications, including ones written in .NET.
Problem is, I need this done quickly and I don't have access to the CVS server, due to corporate IT red-tape, etc.
Is there a way to set this up on one of the client workstations instead?
Can it be done without interfering with my working folder?
Can you get commit notifications by email as this blog shows? If so, you could be able to use maildrop (or good old procmail, etc) to run arbitrary commands and scripts on your workstation when the commit notification mails arrive.
I found a .NET library that seems up to the task - SharpCVSLib.
http://csharpopensource.com/sharpcvslib.aspx
(Hopefully it will work on a developer workstation and not need to be hosted on the CVS server.)

Resources