eslam-gomaa / Owncloud-resolve-conflicts

A Python script to resolve OwnCloud conflicted files. (From the server side)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Owncloud-resolve-conflicts

A Python script to resolve OwnCloud conflicted files. (From the server side)

Approach

When the script is executed (usually periodically via crontab) it looks if there are any conflicted files, If a conflicted file found it gets compared with its original file and the last modification wins

Note: I've been using this script for months and works like a charm, if you faced an error please let me know


Prerequisites

  1. Get the WebDav address of your owncloud
Can be found at the bottom left of the owncloud home page

  1. Install the required libraries
pip install requests

  1. Configure Owncloud to upload the conflicted files
On Windows

Variable: OWNCLOUD_UPLOAD_CONFLICT_FILES
Value: 1

On Linux
export OWNCLOUD_UPLOAD_CONFLICT_FILES=1

Usage

Configure the script

Open the script and provide the needed parameters

image

Variable Description
data_dir Owncloud data directory (on the OS)
webdav your Owncloud webdav link
usrename Owncloud account username
passowrd Owncloud account password

Run the script

python owncloud-solve-conflicts.py

Or

chmod +x owncloud-solve-conflicts.py
./owncloud-solve-conflicts.py

Note: The script tested with python2 but should be working with python3 as well.

Prefered way to use it

crontab -e
*/5 * * * * /root/owncloud-solve-conflicts.py >> /var/log/messages
  • Make sure you modify the script directory if different.

This will run the script every 5 minutes, anse send the output to /var/log/messages


.

Please leave a ⭐ if you found it useful

.

Thank you

Maintainer: Eslam Gomaa

About

A Python script to resolve OwnCloud conflicted files. (From the server side)


Languages

Language:Python 100.0%