Avatar of MostHated
MostHated
Flag for United States of America asked on

Transfer files to new ISCSI mounted drive and create smylink from the old folder so that all new files are saved to the ISCSI drive.

Hello all,
    I am using a cloud file hosting application called Owncloud, and they do not have much documentation on trying to move your data directory to a new destination (someone opened a ticket about it and they closed it, saying not enough people cared to do it). Someone replied to my forum post saying that using some standard Linux commands (Using Ubuntu 14.04), that this could be done, as long as only the data directory was move, and not the temporary directory.

    I added a 300gb ISCSI drive that is connected to a new NAS that we have implemented, so I am trying to see what the best way to go about this would be. The data is housed in /var/www/owncloud/data, my ISCSI drive is just in /docs If anyone could point me in the right direction on how to do this, I would be most appreciative.

Thanks!
LinuxLinux NetworkingStorageLinux Distributions

Avatar of undefined
Last Comment
MostHated

8/22/2022 - Mon
noci

The next script should do that:

for dir in /var/www/owncloud/data/*
do
   if [ -d $dir ] 
   then
        user=$( basename $dir)
        cp -r ${dir}/files/*   /docs/${user}/
   fi
done

Open in new window

ASKER CERTIFIED SOLUTION
MostHated

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
noci

From the question i got the impression you just wanted to move the private files from an owncloud instance. to get rid of the instance.
MostHated

ASKER
Ah, my apologies, all data and what not is stored locally on the same server, I just had my data drive as local storage on my server and didn't want to provision that much extra storage on the server itself. I should have clarified a bit better.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
MostHated

ASKER
I was actually able to figure it out perfectly using the below.

https://manandkeyboard.tk/2014/09/15/owncloud-and-an-external-hard-drive/