I am looking for a method to transfer files between Raspberry Pi and a computer with Linux OS on.
I need to do so without FileZilla file transfer.
I wonder if there is a script to do it automatically .
I have an array of files and a corrosponding array of IP's of the receiving Servers on a network how can i map the files to the servers and send them in turn .
any bit of advice is very much appreciated.
So you need transfers files from Pi to multiple Linux computers. If you only have a limited number of computers you need to transfer to, then you can do so manually for each computer, using the scp command.
For example let's say the you need to transfer all files with extension .c found in directory /foo in the Pi to the server named barserver in the directory /foobar. From the Pi you can run:
$ scp /foo/*.c username#barserver:/foobar/
Or equivalently from the server you can run:
$ scp username#piaddress/foo/*.c /foobar/
If you have so many servers that doing it manually would be tedious, then you could write a script.
Maybe it's a little overdone, but you may want to check out Fabric: Generally a deployment tool, but I'm using ist to handle all of my file transfers between all my 4 Raspi's, Uploading config files and starting/stopping services.
Related
I want to run a script on a remote machine without using ssh.. Is it possible?
If yes then what all available options are there in linux?
Here are few details regarding the same.
1) On my machine i have a script, say a.sh, which performs installation of few packages. (such as lsof, ntp, vim etc).
2) I need to copy this script to the remote machine, and i want to execute it over there. (So that those packages get installated on to those machines.
3) what i am trying to achieve is if i have to do these packages installation on n no of machines, then with this mechanism i can automate this part.
Is there any preexisting infrastructure in linux which can help me doing this without ssh? (ssh to these virtual machines/remote counterparts is not possible)
Cheers,
Placid/
Ubuntu one has this form of remote package management availible , although on a personal level I simply prefer to scp / ssh exec scripts like this when deploying a change set to multiple machines .
There are two remote machines, one with redhat linux, the other with solaris. Each has a file (let's say /var/log/events.log) that is rotated daily, can be from 0 bytes to 400Mb in size and is updated constantly. There is a third machine with windows xp, that should monitor updates to that file which is currently done by an ssh session opened with putty and tail -f /var/log/events.log running in it.
There are some restrictions on how it should be done:
I can't use anything except SSH and SCP for remote access.
The solution must NOT require installing, storing or having running permanently anything on the remote servers; it should operate with single connection attempts.
It should have minimal impact on network load, close to that of a remotely executed tail -f
I've looked up how diffing is usually done and found out about rsync. Unfortunately, solaris server doesn't have it installed, and on redhat server, I don't have permissions to launch it.
Any ideas?
The question is rather old, but it seems that you want to use rsync.
According to Wikipedia:
rsync is a file synchronization and file transfer program for Unix-like systems that minimizes network data transfer by using a form of delta encoding called the rsync algorithm.
So you can synchronize the files by they diff, thus saving a lot of bandwidth and time.
Official rsync page is here.
Currently, I'm working on a local Linux machine. I'm trying to use scp or similar Linux command-line tools to copy files from a remote Windows machine to my local Linux. I did some searching and found that most of the solutions are for local Windows cases (like putty and winscp), which don't really help.
Please advise.Thank you.
[UPDATE] Solved by installing cygwin's sshd service on Windows.
If you really want to use SCP, you will need an SCP server (actually an SSH server) on the Windows machine.
For example freeSSHd.
You will need to choose one of the options based on your own needs, there are a number of similar tools and freeSSHd was the first in the list on Google. I've used the Bitvise SSH Server in the past but it is only free for non-commercial use.
They are usually very easy to set up. You install them the usual way and run them for the first time. Depending on the tool, they may pick up your existing Windows users or you may need to manually create some users with passwords within the tool. Then, armed with your PC's IP address, you should be able to connect to the PC using SSH from the Linux command line.
If the windows system has a shared folder you should be able access that with smbclient which is part of the terrific samba project.
Usually somthing like:
smbclient //winmachine/share
Possibly using the -U username options to specifiy the username on the windows box.
Once connected, you can use cd to change folders, and get to retrieve files.
If there is no file share.... I dunno. Create one?
Syntax for copying from remote Windows 10 machine with built-in SSH server. Note forward slashes and drive style. Domain is not necessary.
scp user#domain#example.com:c:/path/to/file.txt .
I've recently been working with the NAO. We're trying to connect the NavChip to it and do some experiments related to robot navigation. The NAO uses a modified 2.6 linux kernel on it's geode system. I've managed to make my NavChip work on it (needed to compile the linux cp210x kernel module etcetera). I can therefore run a C program that came with the NavChip and collect data from it. However, the data can only be logged on the local file system. I'd like to stream this data over the network to a windows machine, since all the processing is MATLAB based. Would anyone have any suggestions on how I can send this data from the NAO to a windows machine?
The NAO's system is pretty limited. It has ssh, and some common utilities like cat etc., but nothing advanced.
I'm not sure I understand the problem properly but I think you've answered your own question you mentioned ssh is installed so why not just scp the file? Using some ssh client on the windows box to remotely connect and download relevent log file.
If you really do need to push the file from the remote host to local machine (rather then connect to remote host and download to local) then netcat should work see here: http://www.g-loaded.eu/2006/11/06/netcat-a-couple-of-useful-examples/
Other wise just write your own socket program in C and pipe the file accross (should be pretty trivial).
For a long time now I have been using a local XAMPP installation on my OS X machine for all my web development. Because updating/maintaing XAMPP is such a pain, I set up an Ubuntu server for my web development.
I would like to know what you think is the best/easiest way to connect to your main development server to edit the files. What protocol do you use (smb, webdav, fdp, ldap, etc.)? Also, do you leave the files on your machine and let the server read the files form your hard drive (e.g. smb via a smb) or do you leave the files on the server?
I would go with SMB as your means of file transfer. How you do this is up to you. It depends on how often your files are accessed, how often they are updated, etc. If you plan on updating the files often (i.e. if you are in a rapid dev phase) then you can link them like you talked about. If the updating is infrequent and the amount of requests are high, upload them to the server. This will decrease the amount of stress on your LAN as the files are requested; in the other method the route would have been modem -- SMB server -- SMB share -- SMB server -- modem, wheras this way it is modem -- SMB server -- modem.
I use an Ubuntu Virtual Machine running the web server, git and vim. So I backup everything my Vim configuration and server config. For me is the fastest way to recover from a crash in example.
Also, you can use vim through ssh by
vim scp://myuser#server.com//home/myuser/file
A simpler example is to view source with an editor syntax, indent
vim http://domain.com
You can save ssh credentials too
I normally use Aptana (an Eclipse derivative) over ssh/sftp to edit the files directly on my server.
If you need to transfer files I suggest using something like FileZilla which will let you connect over ftp or ssh/sftp.
I used to map a SMB share of my LAMP server and edit the PHP files directly with Dreamweaver. Worked really well.
Lol, i'm the first one in the testimonial here. Oh memories.