How to Enable File Upload to Ftp Server Using Cli
We have already seen how to connect to an FTP server and piece of work with it (or its content) through the terminal, that is, without using graphic applications.
This time I bring yous a plus or an extra ... let me explain.
Some years ago I left them a bash script used to brand backups (saves) of data from a server. The script copied a series of folders (like / etc /), exported databases, etc ... and compressed it with a password into a .RAR or .7z file (I currently use 7z), the only affair that the script lacked was to be able to upload then that compressed file to some FTP server, in this way the save from the server would exist copied to some other location.
These days I took upward the script to optimize it a bit, improve it and obviously the need for the latter that I mentioned to you came to light, uploading the compressed annal to an external FTP.
Table of Contents
- 1 How to upload to an FTP with a single command?
- 1.1 Upload to an FTP with ringlet
- 2 And what most that script that is mentioned?
- three The end!
How to upload to an FTP with a unmarried control?
What I needed was through a unmarried command to connect to an FTP with username and password, and well; upload the file to a specific folder.
Last applications that let me to connect to an FTP, put user & password and upload files in that location are lots of them, just… that let me to practise this all in one line, with all the parameters already specified…. hey at that place the question.
Later on reviewing 4 or 5… I thought, huh !! ... only it exists curlicue
Upload to an FTP with whorl
With curl I tin do an space number of things, maybe I tin practise what I want… and that's it!
With the -u parameter I tin can specify the username and password, too with the -T parameter I can tell it to upload a file, and finally to tell it to which FTP and which folder I want to upload information technology, at the end I just put the full path, more or less like this :
curl -u usuario:password -T archivo-backup.7z ftp://192.168.128.2/SERVER_BACKUPS/
What this does is connect to the FTP 192.168.128.two, with the user user and password Password and upload to the folder SERVER_BACKUPS the file called file-backup.7z
And ready!
Simple right? ...
Of course, this can be useful to usa likewise the command solitary, withal, the all-time way to use information technology is with a script such as ... the ane I mentioned before
And what about that script that is mentioned?
I am making improvements to the script, especially incorporating some requests or suggestions from users.
- The first thing I wanted to do was precisely this that I just explained to you lot, with a unmarried control to upload the save file to an FTP.
- The other thing that a user recommended me was to ship an e-mail when the fill-in was ready, for that I tin can use sendmail or external script, I will preferably use sendmail. The detail of using sendmail is that you tin can utilise your GMail account (or any other) to ship the email, with encryption ... SSL and whatever.
- Also, a user recommended that besides, as a more dynamic form of notification, a message exist sent by IM using GTalk's XMPP or Hotmail's (Live or something similar that, I don't even know what it's called). I will try to do it with GTalk first, because for Hotmail I would accept to remember or back up myself somewhere to create a Hotmail account, because with and then much change-change that Microsoft has, no idea what it is similar.
- Another variant of the latter would be to utilise notifications or letters that are sent past Facebook or Twitter. For Twitter y'all could use Twidge while for Facebook you lot could employ fbcmd. Both applications let me to collaborate with these social networks from the terminal.
- I'yard besides thinking of checking the integrity of the sql that I consign, merely this already requires a little more than time :)
The end!
Well, nothing more to add ... for the moment, I am taking up several of my scripts fabricated in Fustigate to optimize and improve them, I hope it won't take me also long to bring news 😀
regards
The content of the article adheres to our principles of editorial ethics. To written report an error click hither!.
mullensthadeciagre.blogspot.com
Source: https://blog.desdelinux.net/en/enviar-archivo-ftp-solo-comando/
0 Response to "How to Enable File Upload to Ftp Server Using Cli"
Post a Comment