Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

6.9.2 Help with commands to trigger a script located in a docker container to recover 54k files from Nextcloud.

Featured Replies

Hello. I am a complete beginner when it comes to code and commands in terminal. I have a lot of dockers but followed tutorials and normally can find an answer to a problem if I have one. This is way beyond my level of understanding however and its so specific I cant find what I need to do it (tried for around 8 hours). 

 

I run the LinuxServer version of the Nextcloud docker. I followed Spaceinvader Ones tutorial for this months ago and it has worked well (greatly appreciate all he does for this community!!). At some point the desktop app for Nextcloud removed all time metadata from every file I had in my Nextcloud server. Now all 54k files wont sync as it says "could not update metadata due to invalid modified time." 

 

This is the link explaining the fix directly from Nextcloud but it is not Unraid specific obviously. 

https://github.com/nextcloud/desktop/wiki/Fix-bug-invalid-modification-date

 

I have created two files as this fix says to do. They are called "solvable_files.sh" and "scan_group_folders.sh"

 

I have put both of these files in the mnt/user/appdata/nextcloud main folder. 

 

The argument it says I need to use to call these files is,

"./solvable_files.sh <path to storage folder without trailing /> <mysql|pgsql> <database host> <database user> <database password> <database name> <user of the webserver> <list|fix> <noscan|scan>"

 

This is where the problem starts, I have literally no understanding of how to do this but with google I have tried several commands I believe would be related. 

 

Closest I think I got is,

"docker exec nextcloud sudo -u abc php ./solvable_files.sh </mnt/user/nextcloud> <mysql> <x.x.x.210:3306> <nextcloud> <MYPASSWORD> <nextcloud> <list> <noscan>"

 

Also tried this,

"docker exec nextcloud sudo -u abc php /mnt/user/appdata/nextcloud/solvable_files.sh </mnt/user/nextcloud> <mysql> <x.x.x.210:3306> <nextcloud> <MYPASSWORD> <nextcloud> <list> <noscan>"

 

To someone experienced with this I am sure this looks completely wrong but I have tried many other commands and variations of this one and cant get any traction. Any help here would be greatly appreciated. 

  • 1 month later...

I did this by copying the scripts to my array somewhere. Looks like you've copied them to your nextcloud appdata directory.

You could map them into your docker container by editing the template and adding an additional path.

I just copied them directly into the docker container by using 

docker cp /pathtoscripts/* nextcloud:/

 

Then open a console window of your nextcloud instance.

Then grant execute permissions to both scripts with

chmod a+x solvable_files.sh

 

Then I had to install mysql with 

apk add --update mysql mysql-client

It's my understanding that these will be cleared when your nextcloud docker container updates next, so don't really need to worry about this.


Then ran the solvable files script with the following parameters.

./solvable_files.sh /local mysql ip user password db list noscan

local is the container directory that is mapped to my data on the array.

ip is the ip address of my mariadb instance, 192.168.x.x. For me this is the same ip as my server.

user is the username of the db, mine is nextcloud.

password is the password for that user.

Then you can either use list to list the files, or fix to attempt to fix them.

Then scan or noscan.

 

Hope this helps.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.