I was using ftp -s:filename on windoze machines in order to FTP files. On the other hand the "s" switch is mising on a Linux based OS. You must use the "<" symbol to redirect input from a file. Furthermore you can implement autologin using .netrc.
login myusername
password mypassword
e.g
machine testserver
login poweruser
password 123456
- Create a file under home named .netrc
- populate file with server entries of the following format:
login myusername
password mypassword
e.g
machine testserver
login poweruser
password 123456
- Execute command chmod 600 .netrc so the owner and only the owner can access the file's contents. If you skip this line the autologin feature is going to fail.
- create a file with the ftp commands you want to execute
- You can now execute ftp testserver < commandfile
- Enjoy
Too.useful.2.ignore
ReplyDeletelol better than pillarhumping
ReplyDeleteΕ ναι ρε. Πραγματικα.
ReplyDelete