Tag Info

New answers tagged

0

Make sure you are using rsync -z to compress over the network. Other options to consider are -H (hardlinks) and -S (sparse files). Before you run your rsync, do a version with -nv which does no updates but shows you which files will be updated. Out of the list of files, use your knowledge to match where a missing file might already exist on the remote, ...


3

From man cp (the GNU version, found on Linux and Cygwin) --backup[=CONTROL] make a backup of each existing destination file -b like --backup but does not accept an argument Example touch 1 2 cp -bv 2 1 ‘2’ -> ‘1’ (backup: ‘1~’) Note that this does not check for existing backup files, i.e. if 1~ exists it will be overwritten. Using ...


3

You could use pv: </mnt/nfs/image.img pv -L 5m >/dev/sda The -L flag limits the throughput to 5 megabytes per second. pv also writes to the stdout so you have to redirect to the target with >.


1

By using \0-delimited strings, this can handle spaces and \n in file names. cd "${PROJECT_DIR%/*}" outdir="output"; mkdir -p "$outdir" find "$PROJECT_DIR" -type f -name '*.log' -printf "%p\0${outdir}/%P\0" | awk 'BEGIN{FS="/";RS=ORS="\0"} NR%2||NF==2 {print; next} {gsub("/","#"); sub("#","/#"); print}' | xargs -0 -n2 cp -T mkdir -p ...


1

#!/bin/bash newdir=/absolute/path/output olddir=/absolute/path/project find $olddir -name '*log' | while read line ; do if [ "$olddir" == "$( basename "$line" )" ] ; then #just move the file if there are no subdirectories mv "$line" "$newdir" else #1) replace old project dir with nothing #2) replace all slashes with hashes #3) set ...


0

(cd "$PROJECT_DIR" && find . -name "*.log") | tar -cf - -T - | (cd $OUTPUT_DIR && tar -xf -) cd to project directory find all of the log files tar's list of log files to stdout cd to output directory untar stdin


1

On Linux, install and run the SSH daemon sshd (the package is openssh-server in most distributions). Then from Windows download and use WinSCP to connect to the Linux machine and transfer your files in both directions. Or - to do this the other way around - install the SSH server freeSSHd on Windows, then from Linux run the command scp ...


0

Setup a SMB-share on your Windows host. Install smbclient on your Linux host (on Debian you can do it with sudo apt-get install smbclient). Connect to your SMB-share with: smbclient //NETBIOS_NAME/RESOURCE -I IP.ADD.RE.SS -N And finally download a file with: get (filename)


1

It's impossible to exclude partial files because there's no such concept. As soon as the producer has created the file, the file exists, but it starts out empty and gets filled gradually. You can test whether the file is open for writing; that would tell you that it's incomplete. However this is not reliable: if the producer crashes (either the process ...


0

If the sizes of the files are fixed (after the write operation of the application), you can transfer only the files based on the size so the files that are not done being written to yet will not be copied : --max-size=SIZE don't transfer any file larger than SIZE --min-size=SIZE don't transfer any file smaller than SIZE options of rsync ...



Top 50 recent answers are included