That's true, in general, but it's not applicable here. I think you got a wrong idea of mhbd's plan.
If we concentrate on one customer only, then it's not simply
it's more like
If you run the latter, the folder reports is copied to new-dest, but then you don't know which customer do those reports belong to.
The result should be new-dest/fd000100/reports
A work-around could be to manually create the new-dest/fd000100 folder before copying like so
but manually created (or restored with non-root?) folder raises another issues, like vbe has forseen correctly.
Hello Guys, thanks for your comments and suggestions.
Here is the current situation. I tried the command mentioned below in our test server which has same
folders structure as LIVE:
It worked fine. It copied all folders and sub-folders with files with original owner & permission at
once in a signle command. But we don't want to run this command in our LIVE server as the folders & files size is 1200GB involving millions of files and it may fail.
So, I tried to copy folders & files year-wise with following command:
It copied all folders and sub-folders with files of year 2003, size is matching with source but owner &
permission changed i.e. not same as source. It seems to me that the tar command could not keep owner &
permission same as original when I put 2 arguments in the command one is fd* and another is /*2003*
I searched man tar but no clue found.
Note: each parent folder's owner is different. I am running the tar command from root user.
Our source directories are as follows:
In this fd000001 folder there are many such date folders where last 4 digits is year and ranging from year 2003 to 2014
Any further suggestions will be appreciated.
Thanks
Last edited by vbe; 09-08-2014 at 08:53 AM..
Reason: code tags please not ICODE!
Hi,
So i know we use cp -r as a basic to copy folders/files.
I would like this BUT i would like to show the output of the files being copied.
With the amazing knowledge i have i have gone as far as this:
1) find source/* -exec cp -r {} target/ \;
2) for ObjectToBeCopied in `find... (6 Replies)
So I have extremely limited experience with shell scripting and I was hoping someone could point out a few commands I need to use in order to pull this off with a shell script like BASH or whatnot (this is on OS X).
I need to search out for filenames with account numbers in the name itself... (3 Replies)
Folks,
I am hopeful that you may be able to help me out with writing a script that can be run nightly (as cron?) to loop through all subfolders within the "/media" directory, delete all of the files in each of them, and then copy in all of the files from the "/home//sansa" directory to each of... (6 Replies)
Hi,
I just started to learn shell progamming and just can't get my head around the following problem.
I need to do the following:
I have a folder which contains 100+ subfolders. Inside these subfolders there is one folder named 'Morph' and several jpg's.
I need to copy all the files into... (4 Replies)
Hi all
I have a bash script, that loops through a folders files and all subfolders for .shtml files.
It looks for a string and replaces it, creating a backup of the original file.
This all works great, but I'd like, when the backup is done, that the files are then also created in their... (4 Replies)
I have files existing with same names in the folders with date as display below
c:\2010-09-10 <==== folder
arr1.jpg
arr2.jpg
arr3.jpg
arr4.jpg
c:\2010-09-09 <==== folder
arr1.jpg
arr2.jpg
c:\2010-09-08 <==== folder
arr2.jpg
arr3.jpg
arr4.jpg
... (5 Replies)
Hi..
I have 2 servers with linux suse10.
I made a mistake and on one of the servers changed with chmod the permission of root in directory /.
In the other servers the permissions are correct
Please i need a script, to change the permissions of one server 1, using the same permission of the... (11 Replies)
i have users home directories in /home
all the users have some files starting with character e
and i want to copy all these files in a folder in my (root) home
using a script
i tried the script
for i in m5
do
cd m5
cp e1* /home/pc/exam
cd ..
done
but get these... (3 Replies)
So tried:
cp -r -p test1/ user@machine:///srv/www/vhosts/domain.co.uk/httpdocs/backup/
but this didn't work either :(
Anyone able to help with this?
Many thanks
Mr M (3 Replies)