Programming :: Script To Copy File Remotely?

Oct 5, 2010

Any sample script that will copy file to remote server.I'm doing it on a manual process using SCP parameter

View 2 Replies


ADVERTISEMENT

General :: Pscp Copy File Remotely From Windows?

Mar 11, 2011

I need to copy file from my Windows XP system to remote Linux system.

Win location : c:1.txt
LInux location:/tmp

What should be the command?

EDITED: pscp is recognized and OK on my PC.I CAN connect with Putty to this remote Linux PC remote Linux name is s1,hostname is s1host

I tried transfer file with following command:

pscp C:1.txt s1@s1host:/tmp

Got:Fatal: Network error: Connection timed out

It's not clear,is command isn't ok?

View 1 Replies View Related

Programming :: Script To Copy Paste Text From One File To Another (overwriting Part Of The File)?

Apr 19, 2011

I have a .txt-file with ~50.000 lines of numbers, generated by a mathematics program. From this file, I need line ~ 1.100 to line ~16.000 (these lines are always the same btw, this may make the solution easier, dunno) to be copy/pasted to another file, where the lines ~500 to ~15.000 (also, every time the same) should be overwritten by the aforementioned lines...I haven't found or come up with anything that works yet, mostly I find solutions to copy everything from one file to another but I can't find something to specifically overwrite a part of a file with part of another.

View 4 Replies View Related

Programming :: Copy One File Content To Multiple File

May 28, 2010

I wanted to copy one file to multiple new files. I have an idea to write a script and do the operation. But here i m looking for any particular command to do this operation.

View 1 Replies View Related

Programming :: Parse And Modify File Without Creating A Copy?

Nov 4, 2010

I don't think this is a "perl one-liner" of find and replace. I'm trying to auto-fill some information in a listing of files. The simplest example is that in the files the following exists:

I would want the script to find this and populate it with something like -- Date : 20101004-1758

I have a few more similar fields to autofill, and I'd like to do this from within a larger perl script I'm developing to process these files. So, how I perform in-place file modification from within a perl script?

View 3 Replies View Related

Programming :: Copy Lines From Multiple Files To One File Using Sed -w?

Aug 25, 2010

I've been trying to sort this out for several hours and I?m totally lost? I?ve been searching around, but haven?t found the solution to my problem. I have a directory with 100 files. I need to copy 10 lines of each files (let?s say from line 45 to 55) into one unique file. So I guess I could use sed ?w, but I didn?t manage to write the right script. I also tried using a loop to create 100 different files, each one with the 10 lines) to concatenate them later on. But I only got 1 file, not 100.

View 12 Replies View Related

Programming :: Restore Copy Folder&file Permission ?

Dec 16, 2010

I have files and folders various permissions.I copied the files and folders to X server.But I forgot to copy of the permissions.Like is hereHow can restore the permissions?

View 3 Replies View Related

Programming :: Script To Read File And Copy It To Other Detination?

May 15, 2010

I have file in which i have some paths, i want to write a script so that it can read the file and copy the files from the paths to some destination folder which i will specify in the shell.

View 5 Replies View Related

Programming :: Bash Script To Copy Specified Extension File From A Directory?

Mar 12, 2010

I have a directory and sub-directories (4 or 5 depths). There are several type with extension in them (*.mp3, *.wma, *.jpg, etc). I would like to copy the whole directory to another location recursively but only *.mp3 files.

View 11 Replies View Related

Programming :: Copy A File Securely To Remote Host In JAVA?

Feb 2, 2009

I am looking for an API in JAVA which gives me functionality to copy a file to remote host in secure manner like (SCP).

View 1 Replies View Related

Programming :: Write A Shell Script Which Will Check A File Name In A Dir And Copy It?

Apr 2, 2010

I am a novice to the shell script. In my system from db server the log files are enerating with the name log1.txt,log2.txt..... It is capable of keeping 10 files at a time in dir called /db/sis/log1.txt. I want to copy the log1.txt to another directory when ever it generating by attaching the time stamp to it for the back-up purpose. this files will be there for a period of 24 hours. after that the back-up dir should be cleared and it start copying again the fresh file from the same dir.

View 3 Replies View Related

Programming :: Waiting For File To Copy Before Continuing Processing (Python)

Mar 25, 2010

I have a Python script that copies a couple of DLL's and EXE to a directory before running the EXE. It can be a fresh copy or the files can already be in the target directory and are then overwritten. The script uses shutil.copy() to copy the files and that works but as the files are copying processing continues and the script tries to run the files mid copy, causing an error.

I need a way to wait for the files to finish copying before the script continues. Putting the thread to sleep isn't good enough, calling os.system("copy ...") also doesn't work, using os.path.exist() won't work because the file will exist during the copy.

View 2 Replies View Related

Programming :: Bash Script To Copy Modification Date From A File To His Folder?

Jul 29, 2011

I need this script but I don't know how to do it I have one folder with several folders inside.On each folder a have one MKV or AVI file inside...What I need is a script to change the "modification date" of each folder to the "modification date" of each MKV or AVI that the folder has inside.

View 16 Replies View Related

General :: Copy A Read-Only File And Make The Copy Writable With A Single Cp Command?

Mar 1, 2011

How to copy a Read-Only file in Linux and make the copy writable with a single cp command in Linux (Ubuntu 10.04)? The --no-preserve and --preserve seemed to be good candidates, except that they should "and" the mode flags, while what I am looking for is something that will "or" them (add +w mode).

More details: I have to import a repository from GIT to Perforce. I want that all Perforce depot files are Read-Only (that is how Perforce was designed), while all other files that were derived/copied from depot files are writable. Currently if a Makefile tries to copy a Read-Only file then the derived file will also be Read-only. This leads to build-errors when cp tries to overwrite Read-Only file second time. Of course the --force is a workaround here but then the derived file is also Read-Only. Also I do not want to mess with "chmod" after each "cp" command - I will do that only as the last resort.

View 1 Replies View Related

Programming :: Possible To Remotely Reboot Server Using SSH Over CGI?

Aug 2, 2010

If I can remotely reboot a server using SSH over CGI? I configure the client and server with keys to make ssh without password, and, on the terminal i can make "ssh root@server_ip reboot" and it reboot normally, but, I don't know how to do this on a CGI?

View 3 Replies View Related

Programming :: C - Copy File Line By Line With Some Slight Changes?

Mar 2, 2010

In C, I want to make a program that will take a file and replace it with a file that's nearly the same but with some minor changes. Also, I would like to point out that I'm still fairly much a beginner with C. As for an example of the file, I want to take something like this:

Code:

Random Crap
More Random Crap
Even More
Something That Changes XXXXX

[code]....

I figured the best way to go about doing this was to open the file and a blank file, read the original bit by bit and when it gets to the point that needs to be changed exchange the part that needs to be changed with what it should be changed to, delete the original file, and rename the new one to the correct name. So the first problem I've run into (and I'll probably have more) is that when I'm trying to read stuff from the original file, my program doesn't seem to be finding the original. I'm sure much of my problems will be just from not knowing how to use the C functions so bear with me. Right now I have the following:

Code:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

[code]...

And when I try to run it I get the following:

Code:

Died Here: No such file or directory
Segmentation fault

Right now the length of 50 was just a random test length. Pretty much I was just trying to get it to read anything from the file. In the end I'm going to want it to read the entire file bit by bit, but at the moment I can't seem to get it to read anything.

View 11 Replies View Related

Programming :: Debug Remotely A Java Program With Ddd?

Jun 4, 2011

Is it possible to debug remotely a java program with ddd (data display debugger)?

View 2 Replies View Related

Programming :: Remotely Control A Windows Service?

Nov 20, 2010

I have a java application running under Linux (Suse). My application communicates with a windows service via TCP/IP. I had multiple cases where the windows service crashed and I'm wondering if in such case there is any Linux or java tool I could use to remotely restart this Windows service.

View 2 Replies View Related

Programming :: How To Run Program Remotely Using Custom Environment?

Jun 11, 2011

I am trying to to execute multiple programs on multiple remote machines. Each program needs to be run in a custom Environment that is not known at login time. Currently I am using ssh to connect and run the program.
My issue is that I'm not sure how setup all the Environment Variables that I need on the remote machine. I was able to write all the environment variables/values (NAME=VALUE) that I needed to a file and place on a shared file server (prog.environment). I thought the best way to approach this would be to write my own utility (custom.shell) that would interpret the environment file and then execute the desired command.

View 5 Replies View Related

Ubuntu :: Remotely Wake On Lan - Remotely Turn On Computer

Jan 4, 2011

Does anyone know or recommend some software or a script to remotely power on a PC from standby to on, or even better from completely off?

I guess the completely OFF to ON is much more complicated - would probably require an extra piece of hardware(?)

View 2 Replies View Related

Networking :: Remotely Login To Remotely Display Data?

Jun 29, 2011

I'm not terribly new to Linux, but I am new to the forums, so hear me out! I am in the process of creating an electronic mapwall for our meteorology program, and have designed the computing system from scratch. I have two Linux Boxes, each with capabilities for 6 attached monitors...a total of 12 displays driven from two machines. My intention is to have one machine be the master...it has a touchpanel control. The inputs to the touchpanel will then trigger events for the both the master and the slave machine to display. Each of them has a specific IP address (DNS entry), and are not on a subnet.

Now...is there a way to remotely login to the slave machine and have it display on it's OWN monitors? The code is Java and which works on the master machine to animate directories of .gifs for each of the master's attached monitors. I will most likely have Java execute shell commands for the remote login (ssh), but I believe the answer lies somewhere in the X-configuration. Do I have the machines in an adverse configuration (creation of a subnet would be better)? Lots of questions...lots of desire...few answers!

View 2 Replies View Related

General :: Deploy War File On Tomcat Server Remotely?

Aug 20, 2010

I want to deploy war file on tomcat server remotly.

View 4 Replies View Related

CentOS 5 :: Ssh - Execute The Script Remotely / File Not Found?

May 28, 2010

ssh - execute the script remotely / File not found: ''I am uisng amazon ec2-api-tool & ec2-ami-tool

i was unable to execute through ssh. Getting error as File not found: The same script i can able to run directly in client machine successfully. Through ssh i was uanble to run the script remotely Source : myScript.sh ec2-create-volume --size $1 --availability-zone $2 $ssh -i key.pem root@myhost ./myScript.sh 10 us-east-1a In remote machine i have permission for myScript.sh as -rwxr-xr-x

Note:Reference link

1) How to create an ebs image from an existing ec2 instance
2) Building EBS Boot and S3 Based AMIs for EC2 with Ubuntu vmbuilder - Alestic.com

View 1 Replies View Related

Ubuntu Servers :: Extending File System Partition Remotely?

Aug 24, 2010

I'm still pretty new to servers and ubuntu and have ran into something I could see being a problem in the future. On a dedicated remote server I have installed a web server using the "How To Forge - Perfect server set up for ubuntu 10.04 and ispconfig". I have a forum and email up and running and shoutcast radio and teamspeak3 servers also. We can also nx into it if need be. I can reformat the 1T hdd remotely from my provider control panel and ssh is installed at the same time and a new root password is sent via email. The thing is I now realise that by default the file system is written to a 10gig partition.

This might usually be ok but ispconfig uses the /var/www folder on the file system to house the forum I host and the partition is filling up. My mate I co rent with is talking about starting a parrot/bird owners forum and i might eventually like to have a gaming forum as well. I realise I should probably have set things up differently but like I said I am new at all this and tbh the home directories never going to have much in it so theres 900 gig doing nothing. So my question is can I use anything to enlarge that partition remotely? I know theres gparted on disc and all the articles I found say I need to use a disc which obviously is out of the question.

So what I think I need is some sort of partition magic for ubuntu. I would really like to expand it so all my current files etc on it would stay as is. I'm also currently looking into back up methods and wondered if that would be the way to go? Back up my file system and home directories and then reformat and make the partition larger? Or could I copy the entire www folder to a newly created folder in /home and re write the site enabled files to point to it? Would this work and if so what else would I need to edit?

View 9 Replies View Related

General :: Copy Certain File Types Recursively While Maintaining File Structure On Destination?

Jun 14, 2011

I have just been bothered by a fairly small issue for some time now. I am trying to search (using find -name) for some .jpg files recursively. This is a Redhat environment with bash.

I get this job done though I need to copy ALL of them and put them in a separate folder BUT I also need to keep the order intact after copying.

For e.g - If I get a JPG file under /home/usr/new/1/ then the destination also needs to be /test/old/new/1/.

At the moment, I am simply putting all files under /test/old/ and I can't somehow get the later /new/1/ folder path created under /test/old/

I understand this could well be done using while OR if else loop, though if someone can just guide me with a hint, I would be really grateful.

I will complete the rest of the steps and was asking here since I am still not comfortable with the shell/bash scripts yet and planning to be really good at it over the next couple of months.

View 1 Replies View Related

Debian Configuration :: Can't Copy A File From SMB Share To The Local File System

Aug 17, 2015

There is this bug in the latest version of Ubuntu, which is also Jessie, which is:

Can't copy a file from SMB share to the local file system: Software caused connection abort

The problem, apparently, is that newer versions of Samba hit servers with multiple requests at the same time, and for some reason the Zyxel and Iomega boxes can't handle this. The best solution they've come up with is to modify the smb.conf file on your server to include this setting: "max mux = 1".

Here is the reference material on this bug: [URL] ....

People who develop samba have fixed it in the latest version but neither the ubuntu nor Debian have released the fixed version of nautilus, as of yet. Here, is the reference: [URL] ....

View 0 Replies View Related

General :: Copy File Whose Source Path Is Mentioned In File To Specified Destination

Jun 3, 2010

I had a situation in which the the path of the file to be copied is written in other file and I had to copy it using shell script..I can use cp $(cat /home/robert/location.txt) /media/sda1 on normal linux shell...But I am using buildroot script where $(cat /home/robert/location.txt) evaluate to nothing..is just blank..

View 1 Replies View Related

Ubuntu :: Copy The File Via SSH \ Save The File Via SSH To This Server?

Mar 22, 2011

Now i install the Ubuntu 10.4 64 bit on Sunfire X4170I want to save the file via SSH to this server.But i m not sure how to configure.

View 4 Replies View Related

General :: When Copy File And Then Power Off / On Copied File Is Gone

Nov 16, 2010

I have an embedded linux system (Debian 'Lenny') which booting from a microSD flash. If I make a copy of a file on the flash file system (cp test test1) and then power off (disconnect power spontanious). Connects power again and the system come up, but the file test1 is gone. How can I secure that test1 is NOT disappear if the power get lost?If I copy file and then restart system with reboot command, the file test1 does not disappear.

View 7 Replies View Related

General :: Copy Some Text In One File And Paste It To Another File?

Sep 19, 2009

favor and let me know how can I copy some text in one file and paste it to another file ,when both of the files are being opened by vi text editor ?

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved