A Python script to resolve OwnCloud conflicted files. (From the server side)
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
- Get the WebDav address of your owncloud
- Install the required libraries
pip install requests
- Configure Owncloud to upload the conflicted files
On Linux
export OWNCLOUD_UPLOAD_CONFLICT_FILES=1
Open the script and provide the needed parameters
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.
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
.
.
Thank you
Maintainer: Eslam Gomaa