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..
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
I really missed the old Ubuntu file/dir. copying feature. When I copied in nautilus file explorer and paste into a terminal or text editor, I got the exact path (eg. /home/user/abc.txt), but when coming the Ubuntu 10.04, it added some "file://" prefix to the actual path (eg. file:///home/user/abc.txt), and I always had to manually delete the "file://" prefix. I don't see clearly that we need to place "file://" in front of the actual path (maybe just in the case we want to put the path in an Internet browser?). Wish this reversed back.
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.
Im usign photorec to recover some files that i lost during a format to my hard drive.
The program works like a charm but put all the files on differents folders. i use the find command to put on a list the jpg files but how i use the cp or the mv command to move that files in the list to another folder?
I'm taking here about tins of directories, thousands of files. I'm looking to find a command that makes me able to move the results above to another path, and to create that path once it doesn't exist like below:
We used to send files in the form of .jpg, .tif, and/or .pdf. Normally the file name will be in the form of 08072011IE01CTYHUB.PDF (DDMMYYYY - is the date, IE - publication, 01 - page number, CTY - edition name and HUB - destination in three characters). These files will be stored in a common folder (say SOURCE). I need a script to move these files to destination by reading the destination from the file name through FTP. At destination these files should be moved to a folder meant for CTY. Please note before the file is sent through FTP it should be compressed (zipped) At SOURCE folder the files will be as:
etc. where first 8 characters are date in the form of DDMMYYYY, next 2 characters are publication, last 3 characters are destination, previous 3 characters are edition and left over in the middle are page number in the form of NN or name. Presently I am zipping these files and send it through FTP to the destination. At destination my counterpart takes the file, stores in appropriate location (like folder name CTY) for use. To automate the above process, I want a script.
I am trying to compile C source file to generate .trb file (turbo file) which will then burn on trubo sim using TP2. When I comiple the code following error is occuring. before going through belwo error I was getting error 'Unknown MCU atmega128', known MCU are: (list appread), then I change the configuration and set the MCU to supported list then following error is occuring.
Today i am trying to learn how to use sed. I set up a testing folder with the following files:
AAb.lol AAc.lol AAx.lol test.sh
My goal is to create a script (test.sh) which renames all the files to their original name without AA. I want to end up with this:
b.lol c.lol x.lol test.sh
sed seemed to be the perfect tool so i went ahead and created a script which i think should clear the job.
mv: missing destination file operand after `$i' From that 2nd line i can tell that $NewName is just empty. I also read something about sed needing the -e option for scripting purposes but i just don't understand it.
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.
Many years ago, I converted a portion of my files to an arbitrary format with a specific extension. i no longer desire to have them in this format and i would like begin the process of replacing them because conversion is not an appropriate solution. unfortunately, they are mixed in separate folders of the same root folder with files in my current format of a different extension. I feel it would make this process easier if I were to move every folder that contained a file with the undesired format to a separate root folder. The files are stored on a Linux server and shared via samba. How can I do this with a couple of commands or a script? I am open to other suggestions as well. I want to avoid time spent editing text files. Ultimately, I'd like a command that produced a list of full paths for folders, sorted by the number of levels would be a nice touch. A list of all of the files is clearly not what I'm looking for.
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.
I have asked this over on Launchpad and have found bugs filed on the eclipse bug tracker but it seems to be going nowhere so I guess ill ask here.
I am using Eclipse for some development work and having saved a file, defocus the eclipse window (to test changes in a browser) when I refocus the eclipse window I get the following error...
The file 'path omyfile' has been changed on the file system.Do you want to replace the editor contents with these changes?
I have searched and searched and this seems to be a CIFS/SAMBA problem. I even found one solution suggesting that changing his mounts from cifs to smbfs fixed his problem however that would appear not to be an option for me since using smbfs in the fstab causes cifs mounts. This problem would seem to occur in Bluefish as well as some other IDE's so it is not an Eclipse issue.
---------- LINKS TO RELATED ---------- Launchpad Question Eclipse Bug --------------------------------------
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.
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: 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]
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
I have just installed SABnzb application in my home folder. The executable file is SABnzb.py When I run the command in the Konsole # python SABnzb.py I have this Quote: python: can't open file 'SABnzbd.py': [Errno 2] No such file or directory