Unix Shell script to copy files from unix location to windows FTP - unix

Could anyone provide me Unix shell script to copy files from unix location to windows FTP location.
Thanks,
Chaitu

I'm going to assume you have access to the unix box. Sounds like a simple cron job using ftp. You'll need to review the crontab syntax to set that up. Check out this article on scripting FTP to get you started there.

Related

How to copy file from desktop to unix using ssh terminal command

I am trying to copy a file called TEST.txt from my desktop to Unix server using SSH client. What command would I use to accomplish this task?
Many thanks!!
You need to use scp, like so:
scp /file/to/send username#remote:/where/to/put
Take a look here for more help: https://unix.stackexchange.com/questions/188285/how-to-copy-a-file-from-a-remote-server-to-a-local-machine
I assume you are running a Windows desktop. You can use the SFTP tool in PuTTy or FileZilla to copy files using your ssh credentials.

Automated delete on SFTP server (PuTTY? WinSCP?)

I'm searching for a solution to easily delete files on a SFTP server automatically after a specific period of days.
I read something about automation via PSFTP from PuTTY and WinSCP. But there are no examples for deleting files...
With WinSCP, use the rm command with a filemask with a time constraint (to select only files with certain age, if I understand correctly, what you want to do).
E.g. to delete all files older than 5 days:
rm *<5D
For all the other instructions to assemble a script and schedule its run, see:
Automate file transfers (or synchronization) to FTP server or SFTP server
Schedule file transfers (or synchronization) to FTP/SFTP server
See also:
Documentation for the rm command;
Documentation for the file masks.
SFTP server is also a SSH server. Write a simple code in any language that you're comfortable with and schedule it with crontab.

Download a file from remote server in UNIX

I have a file on a remote server that I can connect to via ssh. I would like to copy the file from the remote server at the path: '/home/example.txt' to my computer's desktop.
Should I be using wget, sftp, ftp, or simply rm?
Bonus points if you know a good resource for UNIX documentation, since google's results were not great.
Use scp(1):
~$ scp user#host:/home/example.txt .
None of them, you should use scp
scp or rcp if you don't want/need to be secured. Or alternatively rsync will be nicer for anything more complicated with remote file transferring on a regular basis.
For the documentation, look at the man pages, ex: man scp. Or online at
http://linux.die.net/man/1/scp
http://linux.die.net/man/1/rcp
http://linux.die.net/man/1/rsync
Try Filezilla Utility
More info on http://filezilla-project.org/

Example SFTP batch upload script for AS400 server to upload to a Unix SFTP server

Suppose I have a file called helloworld.txt on an AS400 and I want to write a script to automate the daily upload of the source file helloworld.txt on an AS400 server to upload to a Unix SFTP server, say sftp://exampleunixsftp.com?
Does someone have such a script? Is OpenSSH the only tool that can be used on the AS400 to get this accomplished or are there any other methods? If LFTP could be installed on the AS400, that would be an easy solution but since it's only for Unix/Linux/Win/Mac then I don't have this option. I read Scott Klement's article at:
http://systeminetwork.com/article/ssh-scp-and-sftp-tools-openssh
I just need an example basic script to get this done. I'd appreciate this.
The MidrangeWiki topic on SSH has some information and examples that may be helpful.
sftp is intended primarily as an interactive utility. scp performs the same function non-interactively.
The command, once authentication is set up, would simply be:
scp helloworld.txt username#exampleunixsftp.com:<destination path>
LFTP can be installed with some preparation in the PASE environment. See Open Source Binaries. Currently offline. Use the Google cache.

Script to recursively look for a file on ftp server until it found

I just want to transfer a file from ftp server to unix folder, --this is stright forward.
if the file doesn't exist on the ftp server, then the script needs to run recursively until it finds the file. Please let me know how do i get that file.
please remember script has to run on ftp server.
Thanks
CK
I'd mount the FTP server with curlftpfs http://curlftpfs.sourceforge.net and then use it like it were a local file system — for example, run find(1).
You need to write a program to automate your FTP session. You can either write your own custom FTP client, not that hard if you know a few things about network programming, or write a script to automate a session for an existing client. For the latter approach, I suggest using Expect if you are proficient with TCL, or PyExpect if you prefer Python. Expect is a library designed to automate interactive tasks like downloading a file with FTP.

Resources