How to archive multiple files in sftp directory and move those files to an other directory? - sftp

I have an sftp folder where 200 files will be dropped on daily basis.
I need to archive these files and move them to another sftp folder in 1 shot instead of moving 1 file at time.
Basically, I want to archive/move the files into a separate folder without using foreach approach of archiving and writing file by file.
Is there an approach that I can follow to achieve that.
Thx

The SFTP Listener source has a Move To Directory configuration to set a directory to move the files received to that directory.

Related

How to download files from SFTP that doesn't have actural files in Synapse?

I have a little bit complicate situation here:
I need to download files from a SFTP daily. I connect to the SFTP with username and SSH key, the keys have a passphrase.
This SFTP has no actual files. All the files on the server is 0 bytes. The server will dynamicly generate the file if it get a "get" command.
So when I connect the SFTP with Winscp, everything went perfectly.
But I have to do it in Synapse.
I managed to connect it in Pipeline with copy activity, and I managed to download all the files, but with no data content inside.
Does anyone know how I can download the files with content?
If you actually have files with content in SFTP location, then they should also be automatically copied using the pipeline in your Synapse. In case if you just want to copy the files that are having the content and ignore empty files, then you will have to use a get metadata activity to check the size of the file (i.e., > 0 bytes) and then filter those files only to copy to your desired destination. Using the childItems you can get the fileName, Type and Size and use these properties in the subsequent copy activity to only copy filter files to your destination.

What is the difference between a folder and an archive?

I am learning about .tar.gz files while reading about the gzip utility. I read here that tar utility is used only to create an archive and not for compression.
So why do we even need archives when they are same as directories? (A collection of files and folders.)
So that you can put a directory structure into a single file, which makes it possible to send it to someone or to save it. Then they or you can reconstruct the directory structure from that file.

Is it possible to use rsync to sync all files of a given type recursively?

Every iOS device we have automatically uploads photos and videos to its own folder inside an SMB share on our Ubuntu box.
On my mac, this would be /Volumes/Ironman/familyMedia/<iosdevice>
So each device has a folder under /familyMedia
If I wanted to move all of the video files from each device's sub-folder into a single folder: /familyMedia/videos while preserving all of the meta data and date information for the file (rsync -azvp), could I do this with rsync.
Basically rsync would find all *.mov files in the familyMedia folder structure, recursively, and move them to one folder.
Possible?

download directory and sub directories off a virtual repository

Wondering if there is a way to download the root folder plus a bunch of sub folders (and sub folders of those folders) with all the files and keep them in their respective folders.
I've tried some firefox plugins like flashgot and download-them-all but they grab the actual web files in addition to the files in the repository, but only if they are visible. For example, if I don't collapse all the folders and expose the files in the repository, the plugins won't detect them.
I would just collapse all the folders and expose the files but these plugins won't recognize the folders...they just download as "foldername".html .... and all the files are mixed together in one folder.
I've also tried visualWget and allowed recursive downloads but again, this only grabs the actual website files, not the files in the repository.
If anyone could help it'd be greatly appreciated. I've been copying them manually but there are literally thousands of files and folders so I'm looking for a quicker solution.
As a client you can only download what's accessible. You either need to know the list of files or crawl the pages for the links, which is what the Firefox plugins do.
There's no way to get a list of files on the server without access to the server beyond http (unless the server has webdav or exposes some other api).
I ended up getting it to work. I used the following command in Terminal.
scp -r username#hostaddress:/file/path/to/directory /path/to/my/computer/directory
-r is for recursive so it downloads all files and directories and subdirectors
If you try this be sure to run this command from your local terminal. I made the mistake of doing it from the SSH connection to the server (no negative effects just frustrating)

How to Set File-Location for Files Uploaded using NeatUpload

Salvete! When we set up the asp.net file-uploading control called "NeatUpload", it saves its files to a temporary location, either "YOUR_APP_ROOT /app_data/NeatUpload_Temp/", if the directory is writable, or to the system's temp folder. However, the demo does not seem to actually upload any files, nor does it include an example for saving the files to a particular directory.
How do we save the file we have uploaded and move the uploaded file to a particular folder? My only clue from the documentation is that it has to do with UploadStorageProvider, but I need some help to implement this.
if you read the documentation 3.3 point 6 :
In your codebehind file, process the uploaded file. If you are using
the InputFile control, the uploaded file's client-specified name, MIME
type, and contents can be accessed via inputFileId.FileName,
inputFileId.ContentType, and inputFileId .FileContent, respectively.
If you want to keep the uploaded file, you must use the
inputFileId.MoveTo()method to move the uploaded file to a permanent
location. If you do not, NeatUpload will automatically remove the
uploaded file at the end of the requestto ensure that unwanted files
do not fill up the filesystem. The following code will put the
uploaded file in the application's root directory (assuming sufficient
permissions):
and so on. I hope this is what you are after.

Resources