only practical „workaround“ so far: http://dwaves.de/2015/05/26/linux-simple-local-rsync-example/

(its not really a solution)

there should be a simple command like merge/integrate:

merge /path/A /path/B; # merges all files from A into B, creating directories but NEVER (!) deleting target directories or files

how do i test it?

mkdir A B; # create
cd A;
touch 1 2 3;
mkdir KEEPCONTENT;
cd KEEPCONTENT;
touch 1 2 3;

cd ../../B;
touch 4 5 6;
mkdir KEEPCONTENT;
cd KEEPCONTENT;
touch 4 5 6;

merge A B; # merge the two folders

ls -lah /B; # expected result:

1 2 3 4 5 6

ls -lah /B/KEEPCONTENT; # expected result:

1 2 3 4 5 6

you MIGHT think you can do this like that:

mv -v ./A/* ./B/

but the MAJOR problem with current implementation of mv is that if you have a two subdirs /B/KEEPCONTENT and a dir /A/KEEPCONTENT and you do a mv A B you likey get /B/KEEPCONTENT overwritten/deleted in fact loosing data.

mv -v ./A/* ./B/
‘./A/4’ -> ‘./B/4
‘./A/5’ -> ‘./B/5
‘./A/6’ -> ‘./B/6
mv: overwrite ‘./B/KEEPCONTENT’?

this is rather uncomfortable.

know what i mean? 😀

c’mon guys. ASAP = As Simple As Possible = no fiddeling with scripts/hacker skills needed to merge two dirs = cleaning ladies should be capable of doing such „complicated“ things in the 21st century.

yes i could use rsync… but rsync does not „MOVE“ it only „COPIES“.

so we are f****ed or we learn GNU C and do it ourselves or we spend 3.5 days testing scripts.

not good – we can do better 🙂

links:

http://superuser.com/questions/656301/bash-merge-directories-when-using-mv

http://unix.stackexchange.com/questions/127712/merging-folders-with-mv

admin