LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 08-23-2006, 01:31 PM   #1
kabucek
LQ Newbie
 
Registered: Aug 2006
Posts: 5

Rep: Reputation: 0
How to write a FTP script????


How to write a script or batch file, which compress files in a direcotry, then sends the compressed file through SmartFTP program, and then another script or batch file that check the file checksum??? How to configure SmartFTP that it can use that script for automated uploads??
 
Old 08-23-2006, 02:34 PM   #2
rednuht
Member
 
Registered: Aug 2005
Posts: 239
Blog Entries: 1

Rep: Reputation: 31
I am not familure with smartFTP but ..

1. compress files in a directory
Code:
tar cvzf myarchive.tar.gz /path/to/my/folder/
creates a compressed archive of a required folder.

2. view a checksum
Code:
md5sum myarchive.tar.gz
3. upload file via FTP
create a bash shell script
Code:
#!/bin/sh
# uses ~/.netrc
echo Uploading myarchive.tar.gz, please stand by
ftp <<**
open www.myserverorip.com
cd public_html
bin
put myarchive.tar.gz
bye
**
echo Completed
note the reference to .netrc file in the users home directory?
its horribly insecure as its just a plain text file in the form
Code:
machine www.myserverorip.com
login mylogin
password mypassword
4. check if uploaded file has correct checksum.
Well I guess you would have to download it again or ssh to the machine and run md5sum against it.

As with most linux related things this could be done numerous mays this is just the way I would do it, your millage may vary.
 
Old 08-25-2006, 08:46 AM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Moved: This thread is more suitable in General and has been moved accordingly to help your thread/question get the exposure it deserves.

Because this is a Windows question.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent Help: Perl FTP Script Using NET::FTP xboxter Programming 8 05-16-2005 06:57 PM
How to write a shell script to download a file via FTP? guarriman Linux - General 4 12-21-2004 09:31 AM
FTP write Permissions ScottCamp Linux - Newbie 4 10-27-2004 07:15 AM
How to write a Script Blake Linux - Software 6 07-18-2004 11:41 AM
How to write an ftp client (eg.cuteFTP) in C or C++ ? Dinux Programming 4 12-08-2003 11:15 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 11:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration