Copy files into oc

Ask all your questions regarding OC 5.x Please read the Support Forum Rules
Forum rules
ownCloud 5.x reached end of life and is officially unsupported. For details see Wiki page.

Please upgrade your ownCloud.
michaeln
Newbie
Posts: 9
Joined: Fri Feb 17, 2012 9:31 am

Copy files into oc

Postby michaeln » Fri Feb 17, 2012 11:31 am

Hi there,

another thing I am facing using oc that I don´ t understand.

My target: Copy files into oc so that I can see them in the interface
Methods I use: 1. copy via webdav ; 2. Copy locally on my debian box

So here are the results:

- Copy files over webdav: Does work: Show up in the interface
- Copy folders over webdav: Does work : Show up in interface
- Create a file locally via "touch": Does work, Show up
- Create a folder locally via "mkdir": Does work, Show up
- Copy a folder from another folder into oc filesystem: Does NOT work, not visible in interface
- Copy a file from another folder into oc filesystem: Does NOT work, not visible in interface

Of course, I did set the rights / ownerships of copied files/folders to the same as the ones copied via Webdav. Strange enough, I did see another thing that makes me think that there is a bug somehow:

1. Create a folder "testdir" via oc interface
2. Change into "testfolder" via oc interface
3. Create a subfolder here "testdir2" via oc interface
4. Create a subfolder here "testdir3" via bash locally on host system (in my case: debian)
5. Change ownership and rights of "testdir3" to exactly the same as "testdir2"
6. Refresh view in oc interface

Result:
"testdir": visible
"testdir2": visible
"testdir3": NOT visible

What is wrong here?

sb9t
Beginner
Posts: 35
Joined: Tue Feb 14, 2012 4:28 am

Re: Copy files into oc

Postby sb9t » Fri Feb 17, 2012 7:10 pm

I asked the same quesitons here. http://forum.owncloud.org/viewtopic.php?f=3&t=1867

I was on the chat channel last night and it looks like you wont be able to use owncloud this way. You have to use the web interface or webdav. I was also told that i'm not supposed to be playing around in the data folders from the server directly. I was also told that encryption is planned for a future release. So even if you got it working you wont be able to upgrade.

It sucks not to be able to add files and folders directly on the server but Owncloud is still awesome!
Environment: HomeServer
Server: Windows Server 2008 R2 x64
Database: Sqlite
Client: Firefox/Chrome/InternetExplorer
Versions of OwnCloud and PHP: 4.5.1 and 5.x

michaeln
Newbie
Posts: 9
Joined: Fri Feb 17, 2012 9:31 am

Re: Copy files into oc

Postby michaeln » Sat Feb 18, 2012 5:48 pm

Okay, then there is still a workaround: Mount the directory via davfs and copy the files in it. Not a "beautiful" solution, but should work.

Thanks for your reply.

turnerscc
Newbie
Posts: 4
Joined: Thu Mar 01, 2012 10:15 pm

Re: Copy files into oc

Postby turnerscc » Thu Mar 01, 2012 10:19 pm

This is not good, I just copied over 192gb of data to my files/ directory. I really don't want to webdav 192gb of data over the internet back to my server just to get the folders to show up. There has to be a better answer than this.

I also tried the mounting idea and I cannot get it to mount, it asks for all my credentials but then says the server doesn't support WebDav.

Anyone?

Maybe a perl script or something that refreshes the database or whatever the web interface gets it from...

turnerscc
Newbie
Posts: 4
Joined: Thu Mar 01, 2012 10:15 pm

Re: Copy files into oc

Postby turnerscc » Fri Mar 02, 2012 9:35 pm

[Solved]

OK, I found out how to rebuild the DB by total accident today and it is a total workaround, the OC developers need a re-scan DB button to verify changes to the filesystem and update the DB to match... This can take a while if you have a lot of folders and files. I use CENTOS 5.7 so my commands may be different that yours, you should get the general idea. :idea:

1) Copy your files:
*** You may have to set the permissions of your folder and contents to (drwxr-xr-x)
/<owncloud directory>/data/<your user>/files/

2) Make apache the owner and group for all files and files/sub-folders:
chown -R apache:apache <Your folder of files and other folders>

3) Empty(Truncate) the 'oc_fscache' Table:
To do this you have a couple options, either command line or phpMyAdmin

phpMyAdmin:
Login, click owncloud DB, click 'oc_fscache', click 'EMPTY'

Command Line:
Login to DB, 'TRUNCATE Table 'oc_fscache'

4) Login to the webgui:
It should start auto scanning the data to rebuild the oc_fscache table, you will see a message like this:
"Files are being scanned, please wait. 42857 files scanned
Current scanning /...
"
** NOTE ** I tried this with IE9 and it did not show the status, FireFox does so I recommend it so you can see the progress

5) Done. once finished scanning everything will be there, don't mess with it, just let it run.


Other Notes:
If you want to add just a folder and some files and not re-scan the entire DB I found that mounting the path to webdav.php I could rsync files into it and they would show up. (you could also use CP, I like the progress indicator)

Creating mount for WebDav:

mkdir /mnt/DavDropbox/

mount -t davfs https://127.0.0.1/owncloud/files/webdav.php /mnt/DavDropbox/

rsync -rv <your_folder>/ /mnt/DavDropbox/<your_folder>/ --progress


Other Info:
After figuring this out I browsed google and found this page where someone suggests the same thing as a hotfix. Wish I would have found it earlier and saved a bunch of hours. It also looks like it is still 'open' and no one is working on a solution... :cry:
http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-300

Good luck all, I will try to help if you have any questions.

-Brandon

ANGELRR7702
Newbie
Posts: 7
Joined: Sun Mar 04, 2012 4:04 am

Re: Copy files into oc

Postby ANGELRR7702 » Sun Mar 04, 2012 5:59 am

That work fine for owncloud that was configured to use mysql , but for sqlite :

sudo apt-get install sqlite3
cp /var/www/owncloud/data/owncloud.db /var/www/owncloud/data/owncloud.db.backup
sqlite /var/www/owncloud/data/owncloud.db
sqlite> DELETE FROM oc_fscache;
sqlite> VACUUM;
sqlite> .quit

and the same way that with mysql reopen the web page and log in in your owncloud and will show "
Files are being scanned, please wait."

and if everything work fine you can delete the db.backup file
rm /var/www/owncloud/data/owncloud.db.backup

I hope this help somebody ...

knireis
Newbie
Posts: 5
Joined: Tue Feb 21, 2012 6:04 pm

Re: Copy files into oc

Postby knireis » Thu Mar 22, 2012 12:54 pm

Thanks for the sqlite directions, however as i understand this correctly, everytime files change or are added in the original directory (the directory which is being mounted) i have to do this again.

turnerscc
Newbie
Posts: 4
Joined: Thu Mar 01, 2012 10:15 pm

Re: Copy files into oc

Postby turnerscc » Thu Mar 22, 2012 4:21 pm

knireis wrote:Thanks for the sqlite directions, however as i understand this correctly, everytime files change or are added in the original directory (the directory which is being mounted) i have to do this again.


Correct, unless you mount the webdav.php path to a folder, upload via the web interface or use a webdav application. Unfortunately the developers do not have a scan feature for the files directory yet (hopefully soon).


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Community Edition 5.x and older”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests