Posts Tagged SFTP
In my quest for the perfect “in my dreams” backup solution for my Ubuntu VPS, I created this very simple script which can be run as a cron job and can be easily modified to backup any amount of data to any remote FTP or SFTP server.
You could very easily include a database backup by running mysqldump beforehand, but I’m not including it in this script.
This required yafc to be installed, but Ubuntu installations can easily install it by running
sudo apt-get install yafc
And now, for the script:
#!/bin/bash # format of the open command is proto://username:password@HOSTorIP/ # proto is either ftp or ssh # special characters in the username or password are not well tolerated # anything in the EOF tags are direct commands to yafc. Test if unsure DIR=`date +%F` yafc <<EOF open ftp://username:email@example.com/ cd backup-dir mkdir $DIR cd $DIR put -p -r * close exit EOF
Enjoy! Questions, comments, and feedback are welcome and appreciated. Thank you!
In my opinion, one of Ubuntu’s strongest tools is nautilus’ (the GNOME file manager’s) strong integration with remote files, such as those located on remote FTP, SFTP, WebDav, etc.
While Windows has integration, it’s severely limited and really only supports drag-and-drop copying/pasting and open-in-place documents. Compared to nautilus’ ability to edit-in-place and supporting full file operations, Ubuntu really gives the web developer a strong and convenient set of tools that Windows can’t provide without third-party software.
In the following steps I’ll explain how to connect to an SFTP (SSH) server via nautilus’ built-in networking functions.
Open Places > Network
Select SSH and enter your connection details
In this step, you can check “Add Bookmark” and enter a bookmark name. Your bookmark will be added to the “Places” menu for one-click access to your network location!
Enter your password when prompted.
Browse and enjoy!
Questions, comments, and feedback are welcome and appreciated!