Transferring Files to the Omega

The Omega is incredibly powerful in that it is a total Linux figurer. This ways that it has its own filesystem, allowing you to shop files directly on the Omega. It besides means that you can take your files from an external device and copy them to your Omega. This tutorial volition show you lot how you to transfer files using the Onion Console and your browser, equally well as direct from Windows, Mac OS X, and Linux.

Using the Editor App in the Onion Console

The Editor App in the Onion Panel can be used to upload files straight to the Omega'south filesystem.

The console is installed by default after completing the Setup Wizard, but you can read our brief guide on installing the Onion Console for more information.
If you lot haven't installed the Editor app yet, check out our guide on Installing Panel Apps

This works on all operating systems and is a cracking mode to wirelessly upload code to your Omega.

NOTE: It is not recommended to upload files larger than 2MB using this method.

Starting time, open the Editor app in the Panel. Any files you upload will be placed into the current working directory of the Editor, then you lot'll need to navigate to your intended directory in the side bar:

upload-file-button

The green circle shows that my current directory is /root

Now click the Upload File button in the top bar and a prompt will open asking yous to cull which file to upload from your figurer:

choose-file-button

Click that and select the file you would similar to upload. Then hit the Submit button:

submit-button

And your file will be uploaded to the electric current directory:

uploaded-file

And that's all there is to it! A simple and effective way to upload files from your reckoner to your Omega.

Using Windows

The Omega can employ the SCP file protocol to transfer files wirelessly. SCP stands for Secure Copy, and is based SSH (Secure Shell).

In this tutorial we're going to use WinSCP to transfer our files.

You'll need to have Apple'southward Bonjour Service in club to connect to the Omega'due south hostname. You tin can download Apple tree's Bonjour on their website

What is WinSCP?

WinSCP is an open source free SFTP client, FTP customer, WebDAV client and SCP client for Windows. Its main function is file transfer between a local and a remote computer. Beyond this, WinSCP offers scripting and basic file manager functionality.

In short, it makes creating & updating files on your Omega a lot easier!

Getting Started

First, download WinSCP from their site.

Once downloaded, install the application and and so run information technology.

Configure the Connectedness

Connecting to the Omega is super simple. First, make sure your Omega has net connection. If this is not the case, follow the Getting Started guide.

WinSCP Image 1

In the right hand pane, you'll need to set the details for your Onion Omega. Typically these are:

Setting Value
File Protocol SCP
Hostname omega-ABCD.local
Port Number 22
Username root
Password onioneer

WinSCP Image 2

In one case finished, press the "Save" push button.

On the side by side window at that place is a tickbox option to salvage the password, that's up to you. Saving the countersign is less secure, but faster to access your Omega.

You can name the connection and you tin can also yous tin relieve a desktop shortcut if desired.

WinSCP Image 3

Now from the left carte y'all'll see the name you saved the new site as a few moments ago, eg "root@omega-2757.local", click on this, then "Login".

WinSCP Image 4

You will at present effort to connect to your Omega. On success you'll see this in the window:

WinSCP Image 5

If you connection fails, WinSCP will let you know that the host was non found. If this is the case, make certain that both you and your Omega have an internet connection, and that you accept Apple tree's Bonjour Service installed. If you lot don't have Apple's Bonjour Service, y'all can connect to your Omega'southward access point, and connect to its IP 192.168.3.1 .

Every bit this is your first time connecting via WinSCP you lot'll receive a warning similar to the i below. That's to be expected, click on "Yeah"

WinSCP Image 6

You can now drag and drop between folders on your computer and folders on your Omega. Congratulations, you now accept easy remote access to the files on your Omega!

WinSCP Image 7

Using Linux or Mac OS 10

On Mac OS X or Linux, we tin can utilize the command-line utility rsync (remote sync) to transfer files to and from the Omega. It's included with Mac OS Ten and near Linux distributions by default (including the Omega's).

In case you don't take it, only run the below commands to install it on your local machine:

            sudo apt-get update sudo apt-get install rsync          

rsync uses the ssh protocol when connecting to remote servers. When working with an Omega, specify the username as root and provide the countersign when prompted (onioneer by default).

rsync can just send files every bit-is over to the remote server, but if the files already exist then it takes a smarter approach to sending new data. It volition look at the differences between the 2 sets of files, then applies the differences to the files to bring them up-to-engagement.

Push Directories and Files to the Omega

Copying Whole Directories

Showtime make certain you're continued to the aforementioned WiFi network/LAN as your Omega. Then to rapidly copy an entire directory to your Omega, fill in this template with the paths of your folders, where ABCD is your Omega's manufacturing plant name:

                rsync -a <LOCAL DIRECTORY> root@Omega-<ABCD>.local:~/<DIRECTORY TO PUSH TO>              

Example and upshot:

                rsync -a ~/my-cool-project root@Omega-ABCD.local:~/remote-directory  On Omega: ls ~/remote-directory my-cool-project              
Copying the Contents of a directory

To re-create only the files inside a directory, add a / to the end of <LOCAL DIRECTORY> like so:

                rsync -a -five <LOCAL DIRECTORY>/ root@Omega-<ABCD>.local:~/<DIRECTORY TO PUSH TO>              

Example and result:

                ## my-absurd-project contains files chosen file1, file2, and file3 rsync -a ~/my-absurd-project/ root@Omega-ABCD.local:~/remote-directory  On Omega: ls ~/remote-directory file1 file2 file3              
Copying a Unmarried File

To push a single file to the Omega:

                rsync -a <LOCAL FILE> root@Omega-<ABCD>.local:~/<DIRECTORY TO PUSH TO>              

Example and outcome:

                rsync -a ~/my-awesome-file root@Omega-ABCD.local:~/remote-directory  On Omega: ls ~/remote-directory my-awesome-file              

If you get a alarm about connecting to an unknown host, type 'yep' (every bit this is your Omega).

Pull from Omega

Entire directory:

              rsync -a root@Omega-<ABCD>.local:~/<DIRECTORY TO PULL FROM> <LOCAL DIRECTORY>            

Files only:

              rsync -a root@Omega-<ABCD>.local:~/<DIRECTORY TO PULL FROM>/ <LOCAL DIRECTORY>            

Calculation Your SSH Primal

To skip the password prompt, you can add your SSH key to the Omega.

Going Further

This role volition show you all of the in and outs of rsync.

Using a button control, the syntax for the command is explained below:

              rsync -a [<OPTIONS>] <LOCAL DIRECTORY> <USERNAME>@<REMOTE HOST>:<DESTINATION DIRECTORY>            

We'll become over each part of the command below.

  • -a - archive manner. Equivalent to a combination of several operations, including just not limited to:
    • -r - recursively sync into directories
    • -l - preserve symlinks
    • -t - preserve modification times
    • and a few more useful flags (-pgoD). See the full reference for details: rsync Reference
    • The -a flag is a very user-friendly flag that yous'll want to include in most of your typical calls.
  • <OPTIONS> - some optional flags yous can include are:
    • --progress - show progress during transfer
    • -5 - verbose output: the terminal will study events and condition
    • -n - dry run: see how exactly the files will exist synced without actually transferring or overwriting annihilation.
  • <LOCAL DIRECTORY> - The directory containing the files yous want to push. At that place are two ways this tin can be washed, shown below:

    • ~/my_directory - copies the folder itself over to the destination, eg. destination_directory/my_directory
    • ~/my_directory/ - past adding a / at the cease, this means the contents of my_directory. If my_directory had files file1, file2, file3, and so the remote server would receive the files like and then
      • destination_directory/file1
      • destination_directory/file2
      • destination_directory/file3
  • <USERNAME> - the user on the remote system. For the Omega, this will always exist root.

  • <REMOTE HOST> - the URL or IP of the remote server.
    • This can be typically Omega-ABCD.local (ABCD existence your Omega's factory name)
    • Or information technology can be the Omega's IP accost, eg. 192.168.12.34
  • <DESTINATION DIRECTORY> - the directory on the remote server where your local files volition exist sent to, eg. ~/source/my_cool_project

To see the full list of options and behaviours, come across the rsync Reference.