i want to automate the task of uploading of a file at FTP site "uploads.google.com"
how can i achive this
please see here for example
One of the example is depicted as follows :
Prepare a file (say ftp_cmd.txt)with all the ftp commands to upload the files to our specific site
as below:
binary
cd
mput file.*
bye
Now create a batch file with the following content:
ftp -i -v -s:
ex: ftp -i -v -s:ftp_cmd.txt updates.google.com
Now, when you execute this batch file, it will put all files with format file.* to the specified directory.
Related
Hello I'm trying to make a simple .bat file, I'm trying to modify a file after downloading it from another machine.
The problem is the python script needs the full name of the file, so filename* won't work so is there a way to download a file via scp and then somehow assign the downloaded file a variable so the script can find the full name
scp user#192.168.1.X:"C:\Users\user\Downloads\filename*" ./
pythonscript.py filename*
pythonscript.py "%cd%\filename"
I have a .txt with 900+ file names of pictures with full directories (ex: 2017/conference/tsd-60545).
My windows explorer is pulling from an ftp for my company, and has over 160K photos in it.
I only need the 900 images in my .txt file.
Is there a way to automate this? Manual is bringing me to a slow death.
This is untested as I do not have an ftp server to test this with now, but this should work.
Create a batch file with a .cmd or .bat extention, ensure your test file is in the same directory, or specify the full path to it in the batch file.
Basically, you echo the entire connection to a file. Run a for loop to read from your FTP file and do a get or put for each entry in the file. Once it is completed, it will run the ftp command and read from the file.
MyFTPscript.cmd
#echo off
echo user username password> ftpto.dat
for /F "tokens=*" %%A in (myfile.txt) do echo get %%A >> ftpto.dat
echo quit>> ftpto.dat
ftp -n -s:ftpto.dat ftp.imagesserver.com
You can test it first to make sure it is actually writing the .dat file without actually ftp'ing anything adding rem before the last command. like this:
rem ftp -n -s:ftpto.dat ftp.imagesserver.com
Once you are happy that the content of the dat file looks ok, you can remove the rem and run the script which will then do everything.
No need to delete the file as it will re-write it each time you run the command file.
This downloads all jpgs from ftp:://ftp.mydomain.com/2017/conference/tsd-60545
Create a file called "commands.ftp" based on the contents of your txt file using a tool like vim, awk, or sed. Then use the windows ftp command with option -s to process it.
commands.ftp
open ftp.mydomain.com
user myusername mypassword
cd mysubdirectory
prompt
mget 2017/conference/tsd-60545/*.jpg
close
quit
batch file
ftp -s:commands.ftp -n
I want to copy a zip file from an FTP path to a local folder in my computer.
My client previously used coreftp.exe for that purpose. But now he ask us to use ftp.exe [default in windows machine, available at C:\Windows\System32\ftp.exe] for that purpose. The ftp is in the format :
ftp://username#ftpserver.address.com
And want to download it to d:\sample\docs folder on my machine.
I want that in a batch file so that I can schedule it through windows task manager.
So could you please help me to write that command on the batch file.
Thanks a lot in advance.
FTP.EXE is capable of executing script files. So you could just put this into your bat file:
#ECHO OFF
CD d:\sample\docs
FTP -v -i -s:C:\some\path\ftpscript.txt
And something like this into your ftpscript.txt:
open ftp://ftpserver.address.com
username
password
cd myfolder
get some_zip_file.zip
disconnect
bye
This will download some_zip_file.zip into the current directory (d:\sample\docs).
lets say I am working on index.php and configuring style.css that is on css folder. can I transfer both files using comand line to the server using one line?
You can upload a files by creating an ftp command script file (e.g. ftp.txt) with the content:
(username)
(password)
cd /folder-on-server
binary
put c:\myfolder\myfile.jpg
put c:\myfolder\style.css
Then on the command line
ftp -s:ftp.txt ftp.example.com
Based on: http://wiki.tekkies.co.uk/General_Technical#FTP_using_xp_cmdshell_-_sql2k
I have a list of files inside a TXT file that I need to upload to my FTP. Is there any Windows Bat file or Linux shell script that will process it?
cat ftp_filelist | xargs --max-lines=1 ncftpput -u user -p pass ftp_host /remote/path
You can use the wput command.
The syntax is somewhat like this
wput -i [name of the file.txt]
Go through this link
http://wput.sourceforge.net/wput.1.html
It works for linux.With this it will upload all the URLs given in the text file onto your ftp server one by one.
You may want to check out Jason Faulkners' batch script about which he wrote here.