Questions regarding copying files from one place to another

learn more… | top users | synonyms

1
vote
2answers
31 views

Install the content of a folder into another

I'm trying to write a Makefile to install the content of my folder into another on the system. I would like to keep the same directory structure, like this. localfolder ├── a └── b ├── c    ...
1
vote
1answer
29 views

Can I clone a larger disk with lots of free space into a smaller disk

Is it possible to clone an OS disk with all its partitions into a smaller disk. The original disk has a lot of free space and the total used space is much smaller than the capacity of the new disk I ...
1
vote
0answers
21 views

Copy directory tree, changing the target of absolute symbolic links

I wondered if there's an easy way to copy, scp, pipe tar, etc. host1:/base1/dir1 to host2:/base2/dir1. Other than the base directory, all the directory structure should be identical. `host1:/base1/...
1
vote
0answers
45 views

PSCP - why can't it find the file when using non-admin credentials?

I am trying to make a batch script to get files from Windows vm to Ubuntu vm so I decided to use pscp. when I put pscp -l admin -pw pswd C:\path admin@IP:/path the files transfer fine but I don't ...
1
vote
2answers
59 views

Copy files from a directory if name present in a text file

#!/bin/bash while IFS='' read -r line || [[ -n "$line" ]]; do cd /home/Sud/Minimal\ Packages/All/ if [ -d $line ] then cp $line*.rpm /home/Sud/NewFolder/rpms/ else ...
1
vote
0answers
22 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 ...
1
vote
1answer
49 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
2answers
360 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 terminal....
1
vote
0answers
490 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 ...
1
vote
1answer
77 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, ...
1
vote
0answers
134 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 ...
1
vote
1answer
149 views

Copy a rolling “last 2 months” of files

I have a friend who is a photographer and she has a lot of large files as a result. Our current solution is where some files are delivered to my house. I don't have the storage capability to store all ...
1
vote
0answers
27 views

rsync copy only files facade [duplicate]

Is there a way to mirror a directory structure and files there contained with rsync, giving out facade zero length files? I mean, mirroring dirs (-d flag I think) exactly as they are, while not ...
1
vote
0answers
19 views

File transfer help with Ubuntu and ESXi

I have two esxi machines that I want to directly transfer files between. Is there a way I can facilitate that transfer from a third machine that I have Ubuntu 14.04 running on?
1
vote
1answer
295 views

Linux command to copy as hard links, while deleting unwanted files?

I'm looking for a command that behaves both like cp -al in only creating hard links rather than copying file contents, and rsync -a --delete in removing files from the destination that are not ...
1
vote
0answers
71 views

Copying files to a directory shared via ACL doesn't get default mask

I'm trying to setup a simple shared directory on an ext4 filesystem for a group of users to work on. Let's say I just need to give all permissions to all users belonging to the group "workgroup" to ...
1
vote
1answer
826 views

FTP “put” not copying file to remote host when ran from shell script but copies the file to remote host when ran manually

ftp -n ${FTP_HOST} << STOP user ${FTP_USERNAME} ${FTP_PASSWORD} binary lcd ${FTP_FROM_DIR} cd ${FTP_TO_DIR} put ${reportFileName} STOP That is my code which is not ...
1
vote
0answers
193 views

How to back-up files from nautilus retaining the time stamp?

I connected my android tablet (Asus fonepad7 me372cg) to laptop using usb cable. It showed up in nautilus in Ubuntu 13.04. I've to back-up the files in the tablet (specially the videos & photos) ...
1
vote
1answer
818 views

cp /etc/DIR_COLORS ~/.dir_colors not responding

I'm using CentOS 6.5 and Putty. My problem is that directory file names are shown in dark blue color which is hard to read. I google searched and found this link; basically it's copying the DIR_COLORS ...
0
votes
1answer
2k views

Copy file while replacing text in it

I'm writing a script to publish a webapp. While copying files, I must replace a placeholder current_date in a file with the current date. I would start with something like this to define the date ...
0
votes
1answer
109 views

Creating the first backup

I heard that rsync isn't the best one when creating the first backup in terms of performance. Instead it is the best for the later backups. So I wonder what are some better commands for creating the ...
0
votes
1answer
38 views

Capture stdout from ssh session to local machine

I am having to put together a script that will ssh into devices to run a command such as "show running-config" and save the output to a file on my local machine. I have done similar tasks like this ...
0
votes
1answer
24 views

Copy folders has specific part of name and it is content

I have a long list of folder as follow: 001_bat_3513 002_mon_3213 003_bat_3515 004_btt_3540 005_bat_4513 055_bpt_8523 056_bot_3513 058_bat_1513 . . From this list: How can I copy the folders ( and ...
0
votes
1answer
18 views

How do I replace all files in a folder with one file?

I have one file, let's call it image.png. I also have a folder of files like so: picture.png file.png screenshot.png art.png painting.png And so on. What I want to do is replace each file inside ...
0
votes
3answers
162 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
395 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 ...
0
votes
1answer
191 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 ./new-content/folder-c/subdir/...
0
votes
2answers
338 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) ...
0
votes
2answers
628 views

File transfer from AIX to Windows - CR and LF issues (Control Characters)

I have an issue transferring files between Unix(AIX) and Windows. I use the following mount command to mount a Windows folder on Unix. mount -v cifs -n /admin/@dmin -o file_mode=775,dir_mode=775,uid=...
0
votes
1answer
137 views

Filesystem errors when restoring many files

I had an external hard drive that I mounted internally. It came formatted with NTFS, and I wanted to move to ext4. So I copied everything I wanted to keep onto other drives, created a brand new ...
0
votes
2answers
46 views

Copy last used files of total size

I want to copy the last used (or maybe created) files of a total size to another folder. Is this possible without additional tools? I have an USB drive of a certain size that is less than the total ...
0
votes
2answers
449 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 ...
0
votes
1answer
116 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 > /...
0
votes
1answer
697 views

ssh-copy-id different port

i am trying execute ssh-copy-id in one port different than 22 (default). I researched and found the command below $ssh-copy-id -i ~/.ssh/id_rsa.pub "user@192.168.0.1 -p 22001" but, when execute the ...
0
votes
1answer
2k views

Is it possible to use dd to clone only the part of the hard drive which is used?

if only 1/3 of a 300GB hard disk is used. Is it possible to use dd to clone the drive (but only the 100GB that is used)? dd if=/dev/sda of=clone.img
0
votes
1answer
186 views

How to copy a file within its original directory, most easily? [duplicate]

What I want to do is basically cp long/directory/path/file long/directory/path/file-copy This or similar operations are pretty common. Typing out the whole path twice is obviously awkward, even ...
0
votes
1answer
1k views

How to copy files nested in directories that match a pattern?

I'm looking to copy files from subdirectories that match this pattern vendor/plugin/*/tasks/*.rake into a folder lib/tasks I think that this could be done several ways, but wanted to see if a ...
0
votes
1answer
65 views

Using --delete option with rsync

We are using the following rsync command in a script to copy files from source to destination. rsync -av --exclude 'share/web/sessions/' --rsync-path "sudo rsync" /sdata/ 172.31.X.X:/sdata/ &>...
0
votes
1answer
26 views

attempting to create a script, with an alias, that will backup a single file

I want to do this. I want to create an alias called 'bu' (backup). The bu alias would call upon the copy tool to copy any file passed to a directory I will manually setup in /root/backup/ $bu ...
0
votes
1answer
95 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 . ...
0
votes
2answers
257 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 `gphoto2:/...
0
votes
1answer
286 views

How do I copy all files that have been created or modified in the last 12 months?

I would like to copy all the files created in the last 12 months to a new folder leaving behind everything else. Including sub folders.
0
votes
2answers
323 views

How do I run find, maxdepth and other commands on lcd while using ftp?

I have got the command working locally using normal commands. I now need it to run while using ftp. I understand I need to use '!' And instead of copy I will need to use put so it works on the lcd, ...
0
votes
1answer
195 views

Copy tree directory from specific point

I am now sure how to word this, but: I am copying all the newest .zip files each recursive sub directory inside this original folder: "/Users/Stu/Documents/Hoffi Work/FTP Backup Shell Script/...
0
votes
1answer
931 views

Copy files from USB flash drive to root in OpenBSD

I have OpenBSD 5.6 installed on my notebook computer and would like to copy files from my USB flash drive to the root of the installed OS. I figured out how to mount the USB drive using these commands:...
0
votes
2answers
501 views

Copy directory not just the contents

I want to copy a directory into another directory. For example, cp -r dir1 dir2 copies the contents of dir1 into dir2. I want to copy dir1 itself into dir2 so that if I ls dir2 it will output dir1 ...
0
votes
1answer
350 views

Importing files from Windows to Linux [closed]

I would like to copy a CSV file from a Windows environment to a Linux environment. Both environments communicate through a terminal emulator called SecureCrt.
0
votes
3answers
5k views

how to copy files from windows to linux witout password using a script or program?

I did this to copy files between Windows and Linux. C:\Documents and Settings\668340\My Documents\putty>pscp "C:\Documents and Settings\563456\abc.txt" "auto_root@10.39.5.41:/home/auto/" But it ...
0
votes
0answers
41 views

What may go wrong while copying file? [on hold]

I am writing a library as part of learning a new language which copies a file. The task is to copy the file content as using the nodejs Stream API. I am interested in knowing what can happen wrong ...
0
votes
1answer
30 views

Copy files if directory does not exist on target

Can you copy files (using rsync ideally but any scriptable tool considered) from server A to server B skipping directories that already exist on the target, and any files they contain? Server A FEED -...