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.

MostHatedIT ManagerAsked:
Who is Participating?
MostHatedConnect With a Mentor IT ManagerAuthor Commented:
I actually just found something that worked perfectly!
nociSoftware EngineerCommented:
The next script should do that:

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

Open in new window

nociSoftware EngineerCommented:
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.
MostHatedIT ManagerAuthor Commented:
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.
MostHatedIT ManagerAuthor Commented:
I was actually able to figure it out perfectly using the below.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.