I know this is a pretty simple question but unfortantly I can't find any solution for my problem.
I have file called: x.txt inside the root directory /x.txt.
And I want to upload the file into my server in this path: /public_html/backup,
so after the upload it will goes like this - /public_html/backup/x.txt.
I have tried every answer inside this page: How to upload one file by FTP from command line?
and none worked. I found this code:
#!/bin/bash
ftp -n -v host.net.com << EOT
ascii
user uname pass
cd /public_html/
ls -la
bye
EOT
and this is the results:(the username and password are correct)
[root@centos-512mb-nyc3-01 ~]# ./linux
./linux: line 1: $'\r': command not found
./linux: line 3: $'\r': command not found
./linux: line 10: warning: here-document at line 4 delimited by end-of-file (wan')d `EOT
Connected to host.net.com (78.47.98.110).
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 2 of 50 allowed.
220-Local time is now 03:44. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Remote system type is UNIX.
Using binary mode to transfer files.
?Invalid command
331 User admin OK. Password required
530 Login authentication failed
Login failed.
530 You aren't logged in
530 You aren't logged in
Passive mode refused.
?Invalid command
?Invalid command
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.