Programming :: Used The Output Of Search To Copy In Another Destination?
Dec 20, 2010
i want to used the output of search to copy in another destination examlpe. fine /home/* mtime -1 i want to used the output of the find command to copy an another destination
View 4 Replies
ADVERTISEMENT
May 25, 2011
I want to search for 1 file (say test.txt) on first server and all the output of this search to be greped as per my requirement and then transfered on the second server at the same location where they were on first server.
E.g.
output of search of file (test.txt) >> output.txt
/tmp/test.txt
/home/cpan/test.txt
/opt/cpanel/test.txt
Now I want to grep this output to only related to cpanel,
for f in 'cat output.txt'
echo $f | grep "cpanel"
if [ $? -eq 0 ]
then do scp.
But I am bit confused here, as in how to use scp command here.
scp $f root@second_server:/$f ?
View 3 Replies
View Related
Nov 2, 2010
I have encountered a problem:I have "while" loop; at each run a set of outputs is produced but then I need to shift them into a corresponding folder ; otherwise next run the new outputs will be over-written. Furthermore, I need to pipe what I have on the screen inside a file. I have put my code in the following:
Code:
# !/bin/bash
jf="GeoQuery.jar"
[code]...
View 3 Replies
View Related
Jan 3, 2009
After i try to find logfiles follow date/month/year. i want copy this files to another directory with name's directory is time you find(date/month/year).
View 4 Replies
View Related
Feb 9, 2010
I have recently purchased an external hard drive in order to backup my home partition. In my PC I have a "1.5T" drive with several partitions on it, containing OSes and the home partition. The home partition is 1.3T according to df, the external drive contains one partition that spans the entire disk,df reports it as 1.4T in size. Both partitions are ext3. When I use rsync to copy files from the home partition to the external partition, the external disk becomes full, despite the destination - supposedly - being larger than the source. I don't understand why copying files from one partition to a slightly bigger partition should need more space than on the source partition. Does anyone know what is happening ?
Details : I created the partition on the external drive with gparted; gparted reported it the already have several gigabytes in used space immediately after the partitions creation - I thought at the time that this must be normal. The home partition contains many files of all sorts, including lots of big audio and video files. If you are wondering, for all my important files this external disk is only secondary backup, as they are also backed up to the "internet".
These are the mount points :
/mnt/tmp/ : home partition, /dev/sdb6
/mnt/external/ : external partition, /dev/sdc1
I used rsync to copy the files, I know there are more efficient ways to do this, but I wanted to use the same command that I will subsequently run to sync the backup.
rsync -av --progress --stats --recursive --perms --links --delete /mnt/tmp/ /mnt/external/
Next I tried adding the --sparse switch, as I was wondering if the problem may come form sparse files. I don't know however if rsync would go back and shrink the sparse file by just adding the switch and executing the command. I also added --one-file-system, for good measure. Here is what I ran next :
rsync -av --progress --stats --sparse --one-file-system --recursive --perms --links --delete /mnt/tmp/ /mnt/external/
I tried an fsck on the home partition :
fsck -f /dev/sdb6
This is the output from the last rsync :
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: write failed on "abcd.avi": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(302) [receiver=3.0.6]
[code]....
Looking at the destination after a partial copy seems to indicate that the problem is not symbolic links being "expanded". I have not checked the source filesystem for sparse files, nor the destination to see if these files could be larger there, as this does not seem trivial.
Here is some additional info :
$ df /mnt/tmp/
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb6 1415342836 1414173740 369096 100% /mnt/tmp
[code]....
View 2 Replies
View Related
Aug 5, 2010
i want to copy one or more files or directory from one drive to multiple drive simultaneously. It like a cloning a disk. But i dont like clone entire disk. i want to copy/clone only certine files or folder. if any one can know how to copy one source to multiple destination simultaneously.
View 3 Replies
View Related
Jul 8, 2011
I have the following content on the source directory:
source/foo.txt
source/bar/another_file.txt
source/bar2/and_another.txt
I want copy those files to a destination directory which, after copy, shall look like this:
destination/foo.txt
destination/another_file.txt
destination/and_another.txt
How can I do this? It seems that "cp" lacks such an option
View 1 Replies
View Related
Apr 17, 2011
I recently replaced my windows fileserver with one running Ubuntu. One thing I've noticed (which is a annoying) is that when I copy files between two samba shares from my windows machine, it copies the file through my PC to the new destination. On windows shares it just did some sort of local copy (ie it took about 2 seconds) rather than 3-4 minutes. Is this the normal behaviour, is there any way around it on Linux
View 5 Replies
View Related
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
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
Feb 14, 2011
I am trying to use scp in order to copy files from an ubuntu machine to my Android phone. I use connectbot to log in to my ubuntu. However, when I use scp I get an error as if the destination does not exist. The destination is /mnt/sdcard/download on myAndroid 2.2.
View 1 Replies
View Related
Feb 25, 2010
I would like to search for a term within a batch of text files and copy the files containing that term to a folder.
I've read the man pages for Grep, Ack-grep and looked through nautilus, dolphin, midnight commander as well as tried beagle, tracker and google desktop (and looked throught these forums).
I can do this function easily with xp's wagging dog in the Windows search, but would like to find a way in Linux.
View 5 Replies
View Related
Jun 16, 2011
if i will sound stupid but i can't find a command that would echo output of some command. Let's say that i want to echo the third line of ls -a. I know of the tail command but this command starts from behind.
View 4 Replies
View Related
Jun 3, 2009
My manager askmed me to find out all the jpg files in a directory and copy to another destination directory.I tried to write a shell script.But the problem is this source directory contains thousands of subdirectories. The jpg files resides in all of these directories.We have to search inside all these sub directories.I am reallyconfused.Can Any one help me.I am only a beginner to Shell scripting.
View 1 Replies
View Related
Oct 26, 2009
I'm using a single raw socket to read UDP packets from local test network with 1024 ports. Each UDP src and dest port is unique and I need access to IP and UDP header fields. I can stream and process data (in and out) at 100 mbps in linux-rt kernel with very low jitter < 250 usec, 10 usec nominal.
I'd like to prevent kernel from issuing ICMP port unreachable errors back to the sending host, however, I don't want to create 1024 vanilla UDP sockets and bind to each one because of resource constraints. Currently, I'm using iptables to drop the outbound port unreachable messages. Does anyone know of a way (programmatic using C code) to prevent the ICMP unreachable traffic? Perhaps an IOCTL or socket option? I also tried changing /proc/sys/net/ipv4/icmp_ratelimit but that seemed to have no effect. By default the ratemask is set for dest unreachables and a variety of ratelimit values did not change any behavior that I could see.
View 5 Replies
View Related
Oct 2, 2010
Using a default terminal and bash, there is no functionality to search the standard output of commands.
One can gain such functionality using other tools, like emacs shell or screen, but I am wondering why such a useful feature is missing, I do remember a simple C-F used to work in terminals.
Is there a way to make the Gnome terminal app support output search? or is there a better terminal app that support searching output natively?
View 5 Replies
View Related
Nov 11, 2010
I want to pipe the output of a command into grep as the search TERM, rather than the text to be searched, like this for example
Code:
cat /var/log/auth.log | grep date "&b &d"
so that I only see the lines in auth.log for the current day...but obviously that line doesn't work.... is there a way to do this with grep, or even another command?
View 4 Replies
View Related
Jan 30, 2010
This is what I get when following the instructions to fix grub. I type in "grub-install /dev/sda" and that's the error I get.I'm trying to put Ubuntu or Mint on a Dell Mini 9 with 16gb ssd, but no matter what I do I cannot achieve this goal
View 4 Replies
View Related
Jul 25, 2010
For example, if I type ':pwd' to get the current working directory, I can select the text in gvim but I can't figure out how to copy it to the clipboard. If I try the same in console vim, I can't even select it with the mouse. I would like this to work with all vim commands, such as set guifont to copy the guifont=Consolas:h10:cANSI output.
View 4 Replies
View Related
Dec 10, 2010
if we type a command such as "locate somefilename" in the terminal we will get all the paths to the file name as output. If i want to copy only one line from that output how do i do that without using mouse?i need terminal short cut to copy one line
View 8 Replies
View Related
Jul 13, 2010
Can't copy DVD with dd - Input/output error
Code:
kevin@orangebox:~$ dd if=/dev/dvd of=~/Videos/backup.iso bs=2048 count=4169919
dd: reading `/dev/dvd': Input/output error
191160+0 records in
191160+0 records out
391495680 bytes (391 MB) copied, 154.38 s, 2.5 MB/s
View 4 Replies
View Related
Mar 3, 2010
I even threw some video DVDs at it to make sure it wasn't the disc.
Code:
[pickens@acer1 Videos]$ dd if=/dev/sr0 of=POTC.iso
dd: reading `/dev/sr0': Input/output error
5088+0 records in
[code]....
I am getting the same thing on my laptop running Mandriva, oddly enough. Two different drives, two different computers, two different distros and multiple DVDs.
View 9 Replies
View Related
Feb 5, 2010
Is it possible to copy the output into the clipboard without using the mouse?
For example, I would like to do something like this:
$ pwd >> clipboard
View 2 Replies
View Related
Jul 15, 2010
I often have issues starting my window manager--xfce. My computer misbehaves in one of 3 ways, one of which is to fail to open X, but generate several screens of info. I want to paste that info to this site, but since I'm in the shell, not the terminal (please correct my vocabulary if it's wrong here), I don't know how to copy and paste the output, since right-clicking doesn't give me a menu. Even if I could copy I'm not sure the information would be accessible in X. Are there any other options?
View 13 Replies
View Related
Aug 22, 2010
Anyone know how to send output to buffer via putty? Currently I am using vim with windows copy menu, very slow and tedious.
I download xclip but i got the following error:
Quote:cat ../mnt/fs1/tmp/rcentre01.log|xclip
Error: Can't open display: (null)
View 3 Replies
View Related
Oct 26, 2010
I know how to redirect the output of a terminal to a file. For example, if I want to list all the files in ~/Documents and output to a file called test.txt, I would do this: ls ~/Documents > test.txt The question is, can I copy the output to test.txt AFTER I have carried out the command? This would mean that I wouldn't have to know in advance whether I want to copy the output to file. I want to do something like this: ls ~/Documents Then this: <bash command for copying standard output to test.txt>
View 2 Replies
View Related
Mar 3, 2011
I was given a CD for work purposes and when I put the disc into the drive I get 2 disc icons on my desktop. One has data (a pdf file) and the other has serveral audio tracks. I tried to use dd to image the disc but it gives an input/output error immediately without copying anything. If I try to use brasero or k3b to copy the disc it only copies the audio portion. The data portion does not show up in the drop down to copy - only the audio. If I right-click the data (or audio) desktop icon and select 'copy' from the shortcut menu then it creates an image of the audio portion.
for dd i tried:
dd if=/dev/cdrom of=/home/username/test.iso
This give an immediate error with no data written to the iso file.
dd if=/dev/cdrom of=/home/username/test.iso bs=2M conv=notrunc,noerror
This copies a small amount of data to an iso file but it wasn't usable.
View 3 Replies
View Related
Jul 9, 2010
Working on backing up my DVD library. Anyone know why Brasero would fail to copy data due to an input/output error? Movie was Toy Story 2, disc 1.
View 6 Replies
View Related
Aug 22, 2010
to copy a couple lines with v and y and try to past the lines :/here! but if I press p :/p will be written cause it is in insert mode.ay be with :s/string-to-search/
View 13 Replies
View Related
Oct 5, 2010
How can i use grep (or any other command) to check for lines that begin with N number.
E.g. I want to print out commands (from history), but only from the command number 50 until #200.
This one doesn't work:
Code:
history | grep "^[50-200]"
Should print out something like:
Code:
50 cd ~/Desktop
[Code].....
View 4 Replies
View Related