Copy files from 1 directory to another? SOLVED

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

Copy files from 1 directory to another? SOLVED

#1 Post 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?
Last edited by oldyeller on Sat 01 Jun 2013, 16:17, edited 1 time in total.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#2 Post 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.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Copy files from 1 directory to another?

#3 Post by L18L »

Code: Select all

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

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#4 Post by oldyeller »

@L18L,

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


Cheers

Post Reply