Page 1 of 1

Copy files from 1 directory to another? SOLVED

Posted: Sat 01 Jun 2013, 15:03
by oldyeller
Hello Everyone,

I have this script that works to copy the whole directory. But what I want is to remove all the files that are in one directory and than copy what is in another to that one.

Code: Select all

#!/bin/sh

rm -f /root/my-documents/Manna/
cp -dir /usr/local/Manna2/KJV/001genesistxt/ /root/my-documents/Manna/
Any ideas on how to do this?

Posted: Sat 01 Jun 2013, 15:32
by Flash
Have you looked into rsync (rsync --help)? Perhaps one of the rsync options would be a better way to do what you want.

Copy files from 1 directory to another?

Posted: Sat 01 Jun 2013, 15:32
by L18L

Code: Select all

# rm -f /root/my-documents/Manna/* 
# cp /root/my-documents/Manna_another/*  /root/my-documents/Manna 
:)

Posted: Sat 01 Jun 2013, 16:17
by oldyeller
@L18L,

Thanks that did the job-now off to do some modifications to Manna-Reader for next update :D :D


Cheers