Root-made files to fileshare

I’m creating a backup script on the server that sends a .tar.gz archive to the fileshare (/var/www/owncloud/data/myuser/files/backups) however it doesn’t show in owncloud. Guessing it has something to do with permissions and such.

What would I need to do in order for it to show up and sync?

The script is running as root.

Maybe just noise, but are you sure about that path? I would have expected /var/www/html/owncloud//data/myuser/files/backups.

My path is correct, thanks anyways

Any errors? How do you upload the backup file?

Your ownCloud is not going to know about files that you copied into the server storage directory outside of using ownCloud file sync. Check the occ CLI options. I recall there being an option that would trigger a scan for files added outside of ownCloud.

Can’t seem to find anything on this. Can’t actually find any documentation on cli commands. I’m probably not looking at the right place

Have you tried just running occ from the command line (on your ownCloud server)?

1 Like

Fact is: ownCloud is a WebDAV application. Everything imported by using WebDAV protocol is immediately visible and accessible. Everything else, e.g. using rsync or ftp, needs a file scan afterwards, as @LinkP stated above.

$ occ files:scan --help
Description:
  Scans the filesystem for changes and updates the file cache accordingly.

Usage:
  files:scan [options] [--] [<user_id>...]

Arguments:
  user_id                Will rescan all files of the given user(s).

Options:
      --output[=OUTPUT]  The output format to use (plain, json or json_pretty). [default: "plain"]
  -p, --path=PATH        Limit rescan to this path, e.g., --path="/alice/files/Music", the user_id is determined by the path and the user_id parameter and --all are ignored.
      --group=GROUP      Scan user(s) under the group(s). This option can be used as --group=foo --group=bar to scan groups foo and bar (multiple values allowed)
  -g, --groups=GROUPS    Scan user(s) under the group(s). This option can be used as --groups=foo,bar to scan groups foo and bar
  -q, --quiet            Do not output any message
      --all              Will rescan all files of all known users.
      --repair           Will repair detached filecache entries (slow).
      --unscanned        Only scan files which are marked as not fully scanned.
  -h, --help             Display this help message
  -V, --version          Display this application version
      --ansi             Force ANSI output
      --no-ansi          Disable ANSI output
  -n, --no-interaction   Do not ask any interactive question
      --no-warnings      Skip global warnings, show command output only
  -v|vv|vvv, --verbose   Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
2 Likes