Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to config/config.php for 'datadirectory.cli' #19181

Closed
Mannshoch opened this issue Jan 28, 2020 · 7 comments
Closed

Add option to config/config.php for 'datadirectory.cli' #19181

Mannshoch opened this issue Jan 28, 2020 · 7 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement needs info stale Ticket or PR with no recent activity

Comments

@Mannshoch
Copy link

On my shared host I do not have the same access as PHP has so the directory structure is a bit different.

Please add the option 'datadirectory.cli' to set up an alternate data directory If I run a command with occ

@Mannshoch Mannshoch added 0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement labels Jan 28, 2020
@kesselb
Copy link
Contributor

kesselb commented Jan 28, 2020

You can do this already.

  1. Create a new file in config/ folder: datadirectory.config.php
  2. Use something like below
<?php

if (\OC::$CLI) {
	$CONFIG['datadirectory'] = '/path/cli';
} else {
	$CONFIG['datadirectory'] = '/path/web';
}
  1. Be careful: Such a setup is probably unsupported hence not tested. Nextcloud should save path information relatively to datadirectory.

On my shared host I do not have the same access as PHP has so the directory structure is a bit different.

Is that a common setup? I can't see the point of it.

@Mannshoch
Copy link
Author

That is working very well. Thanks.
I'don't know if that is a common setup, but It's the second hoster with such a setup I have.
I'm not sure If I force creating this problem because I changed the datadirectory outside the nextcloud directory.

@ghost
Copy link

ghost commented Feb 28, 2020

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

@ghost ghost added the stale Ticket or PR with no recent activity label Feb 28, 2020
@ghost ghost closed this as completed Mar 13, 2020
@drewjosh
Copy link

@kesselb Thanks so much, this solved the problem!!! (also after app updates or in my case inserting a backup for passwords)

@Micha-Btz
Copy link

@kesselb
This is a common setup on all plesk driven web hoster.
The full path for the website is:
/var/www/vhosts/webxxx.ssd-space.de/cloud/data <- this is the path in the config.php.
And if you login in the path is chrooted to /var/www/vhosts/webxxx.ssd-space.de
so the path on the server is /cloud/data.

The solution you have posted above works, but have some negative side effects.

  1. the cron.php is called and get confused so cron jobs stop.
  2. the cli updater is not usable, because the logfile /var/www/vhosts/webxxx.ssd-space.de/cloud/data/nextloud.log is not available
  3. the updater can't be run, because of the additional file.

Please rethink adding a cli data path :-)

Micha

@Mannshoch
Copy link
Author

meanwhile, I use another solution. I ssh into my account and created a symbolic link from one directory to another. I t work that way since a half year now without any problems.

@drewjosh
Copy link

drewjosh commented Feb 26, 2021

@kesselb
This is a common setup on all plesk driven web hoster.
The full path for the website is:
/var/www/vhosts/webxxx.ssd-space.de/cloud/data <- this is the path in the config.php.
And if you login in the path is chrooted to /var/www/vhosts/webxxx.ssd-space.de
so the path on the server is /cloud/data.

The solution you have posted above works, but have some negative side effects.

  1. the cron.php is called and get confused so cron jobs stop.
  2. the cli updater is not usable, because the logfile /var/www/vhosts/webxxx.ssd-space.de/cloud/data/nextloud.log is not available
  3. the updater can't be run, because of the additional file.

Please rethink adding a cli data path :-)

Micha

@Micha-Btz I used the setup as mentioned from you (and yes I have a plesk driven web hoster). According to the error message on the settings page of nextcloud some background jobs haven't been done since 2 months. So I deleted the file again. For background jobs I use Webcron. When I run the Webcron manually I receive success, but in the settings page I still get the error message. Is nextcloud maybe "blocking" something now?

Cheers

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement needs info stale Ticket or PR with no recent activity
Projects
None yet
Development

No branches or pull requests

4 participants