Questions regarding copying files from one place to another

learn more… | top users | synonyms

0
votes
0answers
18 views

rsync : fixing Permission denied error with no rwx permission

We can see that one of our rsync jobs is failing with the following error rsync: opendir "/share/resources/0731402367/docs/quick-check/answers" failed: Permission denied (13) rsync: opendir ...
0
votes
1answer
33 views

rsync failing to exclude directory [duplicate]

We are using rsync to copy files from one location to another location on a different host. We want to exclude a directory from the source location so that files from this directory are not copied . ...
-5
votes
2answers
41 views

Copying file from one directory to another directory [closed]

So I have this directory called CS under my home directory. Under CS, I have 3 directories called "Q", "W", "E". I want to copy a file in "Q" into "W", but I'm having trouble. I tried numerous cp ...
3
votes
4answers
470 views

Copy All Files With Certain Length File Name

In directory /source I'd like to copy all files with a file name more than 15 characters to directory /dest. Is there a UNIX command to do this? EDIT: Although this question explains how to search ...
2
votes
2answers
59 views

How to duplicate a file a number of times while embedding an index in each file

I have a file named, for example, ascdrgi.txt, with the following contents: tiger lion cat I want to duplicate this file a (variable) number of times by changing the last character of the filename ...
1
vote
0answers
19 views

Search drive and copy source to flat target

I have backups and backups of backups (there are copies of copies) of images spread out over various drives. I want to scan the drives and copy all images from a source to one flat target directory. I ...
31
votes
7answers
3k views

Is it a UUOC (useless use of cat) to redirect one file to another?

If I want to make the contents of file2 match the contents of file1, I could obviously just run cp file1 file2. However, if I want to preserve everything about file2 except the contents—owner, ...
9
votes
1answer
85 views

How to duplicate a file without copying its data with btrfs?

I have no experience with btrfs, but it's advertised to be able to de-duplicate files. In my application, I'd need to duplicate whole directory trees. From what I learned, btrfs only de-duplicates ...
1
vote
1answer
22 views

ZeroCopy using commandline

Does any of the standard copy mechanisms take advantage of zero copy? Ex. cp, rsync
1
vote
1answer
38 views

copying and working on OSX .app files (folders) in linux

tldr; I want to run a script over an external hard drive and tar.gz every folder that ends with .app into their own archive. That is, I don't want them all in one tar.gz file, I want to create one ...
1
vote
3answers
147 views

How to copy symlinks as symlinks from one machine to another?

Let's assume I have two identical systems. On the first system I've created a symbolic link. On the second one I want to copy that symlink via sftp and the symlink shall work the same (i.e if the ...
1
vote
2answers
116 views

See progress in Files (Nautilus)

I am trying to copy a directory containing multiple subdirectories and files to an external drive. It is taking a long time (24+ hours). I copied in Files on Fedora 23 instead of cp -v on the ...
2
votes
2answers
50 views

Find and replace all same files between 2 directories

I want to find all files in dir1 having corresponding same file names in dir2, and replace them with the files from dir2. For example: dir1: first.txt second.txt dir2: third.txt first.txt So I ...
0
votes
1answer
27 views

Migrate to a new vdisk

I have to migrate some data to a new vdisk. But i have no idea how i can do this. The old Vdisk is under /dev/mapper/12345 which is a link to /dev/dm-1 The new Vdisk is under /dev/mapper/67890 which ...
3
votes
1answer
34 views

cp command which partially resolves symlinks

Is there an easy way to copy a directory recursively where symlinks to external files/directories are resolved (target file is copied), but internal symlinks (pointing to files inside the copied tree) ...
-2
votes
2answers
57 views

Comparing files with different extensions but possibly similar contents

I'm stuck on a task and need some help. So the problem is that i need to compare and copy files with 2 different extensions say .txt and .doc . These files may have the same name but different ...
1
vote
0answers
119 views

rsync + renaming the copied files

Is it possible to change the name of the destination file (add some timestamp as a prefix) when copy is done by rsync ? For example, I can use the following command to change the name of the ...
0
votes
3answers
88 views

Script for copying files from a folder and appending md5sum into new filename

I would like to know if this is possible: I have a large number of .mov files in a folder. I would like to know if I can copy the files to a separate folder but include the md5sum in the new ...
0
votes
2answers
64 views

checking rsync run status

We have a cron job running to rsync files from one server to a different host. The cron runs daily at midnight. The file copy is critical for us so we want to monitor the backup runs. We want to ...
1
vote
2answers
218 views

How to copy directory structure from one server to another without root user?

I would like to know best way to copy directory structure from one server(Unix) to another (Linux): without root user servers are not connected (e.g. can't use SSH directly between them) I need to ...
-1
votes
2answers
41 views

Is there a variant of the “cp -a” command that avoids copying from other filesystems?

Let's say I have a directory /data/something with the following subdirs: /data/something/iowa /data/something/wyoming /data/something/burkinafaso /data/something/slovenia All four subdirs have ...
0
votes
2answers
130 views

How do I archive a folder keeping owners and permissions intact?

Is there any way to archive a folder and keep the owners and permissions intact? I'm doing a backup of some files, which I want to move using a usb-stick, which has a FAT filesystem. So the idea was ...
1
vote
1answer
48 views

Syncing folders where multiple files are partially changed

I have following directory structure on remote machine ALLLibs/LibA/LibA.1 ALLLibs/LibA/LibA.2 ALLLibs/LibB/LibB.1 ALLLibs/LibB/LibB.4 for info LibA.1 and LibA.2 are version of a directory, ...
0
votes
1answer
73 views

How to backup all the files that I'm copying before being overwritten?

I have a folder like this: ./folder-a/index.html ./folder-b/index.html ./folder-c/subdir/index.html ./new-content/folder-a/index.html ./new-content/folder-b/index.html ...
3
votes
1answer
83 views

How to limit speed of file copy?

I am copying huge file from NFS mount using dd: dd if=/mnt/nfs/image.img of=/dev/sda I need to limit the speed of reading from NFS. How can I achieve it? The only precondition is to use some easy ...
1
vote
3answers
144 views

Copy filenames, and add path prefix, in a directory, recursively

I have a working directory: /home/myusername/projectdir The working directory contains files and sub-directories. The depth of sub-directories is not known. I want to put all the *.log files into the ...
1
vote
2answers
107 views

Copy files between two hosts

How can I copy files between two hosts the first primary host is running Linux and the secondary host is running Windows. I am looking for a correct command line to use it in terminal/Linux? I tried ...
2
votes
2answers
161 views

rsync option to exclude partial files

We are using rsync to sync two folders on same machine. Files will be written to a source folder from another application. We have the problem that, even if a file is not completely written/copied to ...
2
votes
3answers
977 views

How to copy and add prefix to file names in one step?

I want to copy and rename multiple c source files in a directory. I can copy like this: $ cp *.c $OTHERDIR But I want to give a prefix to all the file names: file.c --> old#file.c How can I ...
13
votes
3answers
602 views

How is install different from cp?

How is install different from a simple copy, cp or dd? I just compiled a little utility and want to add it to /usr/sbin so it becomes available via my PATH variable. Why use one vs the other?
3
votes
4answers
316 views

Comparing each file in two directories and copying it to another if it differs from its counterpart

How can I compare all files in two directories and copy the ones that are different to another directory? For example, say we have dir1 and dir2: dir1: build.gradle gradle.properties ...
3
votes
2answers
149 views

Recursive copy files with rename

If I have input folder files_input that has subfilders like 01-2015, 02-2015, 03-2015 etc and all these subfolders have other subfolders. Each subfolder has only one file called index.html. How can ...
2
votes
3answers
2k views

How to I copy the directory and subfolders but ignore certain files in the subfolder?

I believe the question is best asked with an example. /home test1.txt test2.txt /home/my-folder test3.txt test4.txt test1.txt, test2.txt and my-folder folder are inside /home. ...
4
votes
2answers
2k views

Copy contents of file without displaying the contents

How to copy the contents of a file in UNIX without displaying the file contents. I don't want to cat or vi to see the contents. I want to copy them to clipboard so that I can paste it back on my ...
-7
votes
1answer
165 views

Copying and relative Home

Your current directory is oxford. Make a copy of the file named outline.doc and place it into the sample_dir directory, using relative pathnames. I've attempted everything. sample_dir1 `-- ...
1
vote
0answers
75 views

Is it possible to change file permissions when copying

I have a directory with default ACL permissions that get copied to all files created in that directory, but only if they are created in that directory. Would it be possible to change the permissions ...
0
votes
0answers
27 views

After rsync no files exist

From my Ubuntu server I used rsync to copy all my data to my USB drive (FAT). After copying the data (it needed quite a while to copy so I guess the copying did happen) I deleted it from the server. ...
0
votes
2answers
138 views

Content cached in RAM while writing to disk - Linux

I'm facing this issue since ever I started using Linux Distros. While copying/moving either graphically or with cp one/many big content(anything like big text file, tar.gz archive, iso file, movies) ...
1
vote
3answers
4k views

download file from Internet to server using SSH

Recently because of some problem, I lost all my server files and requested the hosting team to provide me my files from a backup. They will provide me a link from which I have to download a compressed ...
0
votes
1answer
95 views

Copying file from DVD fails

I am running Arch linux on my MacBook (Late 2009 unibody, if it matters). Using the following command, I attempted to copy an ISO that is stored on the disk onto my computer pv /mnt/file.iso > ...
1
vote
2answers
72 views

Copy contents of remote server folder to current server?

I've been searching and I cannot find an answer on any of these sites that will work. I want to copy all of the contents of this folder to my server. Which Linux command should I use to do that? I ...
0
votes
2answers
141 views

how to copy file from my local pc into my android phone?

I want to copy a file from my local pc into my android phone.The android phone was be read as gphoto2://[usb:001,009]/ mv test.mp4 gphoto2://[usb:001,009]/ mv: cannot move `test.mp4' to ...
2
votes
2answers
566 views

Copying latest file from remote server

There is a collection of .doc files, in addition to other types of files, on a remote server (which supports SCP). I am trying to write a script to retrieve the latest (most recently modified) .doc ...
3
votes
3answers
262 views

Copying a Parent Directory into a Subdirectory Without an Infinite Loop

For application specific reasons, I need to copy an entire parent directory into a subdirectory. E.g., cp -r ../ tmp/ The problem with this is that it gets stuck in an infinite loop, recursively ...
10
votes
2answers
460 views

How can I partially copy a file from a broken disk?

I have a broken disk where I need to copy a 60G file from. From time to time the disk resets and I can't finish the copy. I would like to try and copy partial slices and put them all together. How ...
1
vote
2answers
522 views

Copy .txt files in a certain directory

I have an issue in copying my file in my directories. I have .txt and .jpeg files in a lot of directories, and I want to copy only the .txt files according to the directory. For example, I have this: ...
5
votes
3answers
533 views

Copy from remote server which doesn't have rsync

I need to recursively copy a folder from a Ubuntu remote server where I have ssh access. I don't want to follow symbolic links, nor to copy permissions/owner/group, because my client system (Ubuntu ...
5
votes
4answers
4k views

How can I copy a file in a bash script and rename it while copying and place it in the same directory

How would I copy a file "file.doc" and rename it while copying to "file_copy.doc" and place it in the same directory ? And this only by calling the script and adding the file name in the argument: ...
7
votes
2answers
1k views

How to sync two folders with command line tools?

Having migrated to Linux from Windows, I would like to find an alternative software to Winmerge or rather learn command line tools to compare and sync two folders on Linux. I would be grateful if you ...
3
votes
1answer
2k views

Copy a file and append a timestamp

I've got two issues with my script that copies files and adds a timestamp to the name. cp -ra /home/bpacheco/Test1 /home/bpacheco/Test2-$(date +"%m-%d-%y-%T") The above adds Test2 as the filename, ...