GithubHelp home page GithubHelp logo

nextcloud-sync-cron's People

Contributors

donkaos501 avatar hoylen avatar so-rose avatar theottm avatar tonnerkiller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nextcloud-sync-cron's Issues

syncing set of subfolders?

Hi, thank you very much for this script. Is there a way to select only certain subfolders for syncing? In some cases the whole data might be too much for a local machine.

Cronjob does not execute sync job

Hi,

i am not entirely sure if this is a problem with this script or with my raspberry but I configured everything as described in the readme & it runs perfectly when executed manually but it seems as if the cronjob is not executed. Have you got any idea how to debug this?

Skipping?

When I run the script, with the --verbose option, I get this output

nextcloud-sync-cron.sh: skipping (can sync in 3868s)

What does it mean and how can I fix it?

missing value for "local": /home/user/myncs.conf

Running the script, I get the following error : missing value for "local": /home/user/myncs.conf But the local setting within myncs.conf is the same as I am using for nextcloudcm without an error. Therefore, I think that it must be another reason for the error message.

I changed the line 559 within nextcloud-sync-cron.sh from DAVPATH_OPTION="--davpath \"$DAVPATH\"" to DAVPATH_OPTION="--path \"$DAVPATH\"" as mentioned for newest nextcloudcm version 3.5.4 here : [https://github.com//issues/17#issue-1362012912] but without success. And it looks like there is no other version for focal to downgrade.

Any suggestion out there?

davpath option syntax

Hello,

And first of all, congratulations and thank you for your work.
I would like to know how the exact syntax should appear for a particular folder with the davpath option

Thanking you

Yours,

Add note about AUR package

Hey, thanks for this great tool! I've been using it for a few months now and decided to add it to Arch Linux's AUR

I would recommend adding an installation section to README.md and state
Package can be installed from AUR in Arch Linux - nextcloud-sync-cron-git

syntax error

there is an syntax error in line 543:
UNSYNCEDFOLDERS_OPTION=
if [ -n "$UNSYNCEDFOLDERS" ]; then
UNSYNCEDFOLDERS_OPTION="--unsyncfolders "$UNSYNCEDFOLDERS""
fi

shoud be "--unsyncedfolders"

can you please adapt the code?
Thank you!

Issue syncing

Hi
Currently trying to migrate samba server to nextcloud, as i tried using webdav with rsync but way to slow, so im going to try the nextcloud client but as its a server no WebGUI i would need to use the nextcloudcmd
i saw your script and which i need to sync my local files to the new nextcloud server but im not sure if i did this correctly

  1. i downloaded the script
  2. created a configfile

Config file for Nextcloud sync cron

local: /opt
remote: https://192.168.3.95
username: cloud
password: mypass
trust: true

then run this command
./nextcloud-sync-cron.sh --verbose configfile

but it get stuck there does not show any output

Currently running it on ubuntu 16.04 LTS

Thank you

Process not stopping after Error: "404 Not Found"

Hi, first thanks for your script :)
But I am having trouble sometimes with it. The process just runs forever so it doesn't try again if a error happens. Is it possible to give the process a timeout time?

Here is the problem I am having. To be honest i am not sure what is causing it. I have 4 cron jobs with your script for different directories. Only for my Documents directory I am running into this problem.

04-24 11:54:06:423 [ info nextcloud.sync.networkjob ]:  OCC::GetFolderEncryptStatusJob created for "http://192.168.0.37" + "remote.php/webdav" ""
04-24 11:54:06:424 [ info nextcloud.sync.propagator ]:  Starting INSTRUCTION_SYNC propagation of "Wohnung/folder 65/private.pdf" by OCC::PropagateDownloadFile(0x559ab823a0)
04-24 11:54:06:424 [ info nextcloud.sync.accessmanager ]:       6 "PROPFIND" "http://192.168.0.37:8997/remote.php/webdav/Wohnung/folder 65" has X-Request-ID "283de58f-704b-4dfd-9cc9-4ce35bea497d"
04-24 11:54:06:424 [ info nextcloud.sync.networkjob ]:  OCC::GetFolderEncryptStatusJob created for "http://192.168.0.37" + "remote.php/webdav" ""
04-24 11:54:06:588 [ warning nextcloud.sync.networkjob ]:       QNetworkReply::NetworkError(ContentNotFoundError) "Server replied \"404 Not Found\" to \"PROPFIND http://192.168.0.37:8997/remote.php/webdav/Wohnung/folder 65\"" QVariant(int, 404)
04-24 11:54:06:588 [ info nextcloud.sync.networkjob.clientsideencrypt ]:        GetFolderEncryptStatus of QUrl("http://192.168.0.37:8997/remote.php/webdav/Wohnung/folder 65") finished with status QNetworkReply::NetworkError(ContentNotFoundError) "Server replied \"404 Not Found\" to \"PROPFIND http://192.168.0.37:8997/remote.php/webdav/Wohnung/folder 65\""
04-24 11:54:06:588 [ warning nextcloud.sync.networkjob.clientsideencrypt ]:     *not* successful, http result code is 404 ""
04-24 11:54:06:646 [ warning nextcloud.sync.networkjob ]:       QNetworkReply::NetworkError(ContentNotFoundError) "Server replied \"404 Not Found\" to \"PROPFIND http://192.168.0.37:8997/remote.php/webdav/Wohnung/folder 65\"" QVariant(int, 404)
04-24 11:54:06:646 [ info nextcloud.sync.networkjob.clientsideencrypt ]:        GetFolderEncryptStatus of QUrl("http://192.168.0.37:8997/remote.php/webdav/Wohnung/folder 65") finished with status QNetworkReply::NetworkError(ContentNotFoundError) "Server replied \"404 Not Found\" to \"PROPFIND http://192.168.0.37:8997/remote.php/webdav/Wohnung/folder 65\""
04-24 11:54:06:646 [ warning nextcloud.sync.networkjob.clientsideencrypt ]:     *not* successful, http result code is 404 ""

I think it has something to do with if files are changed while trying to sync? or something like that.

Edit: even if I kill the process manually I get the same error again with a new process ID so it is not about the process running forever.

exclude list not working anymore

hey, everything worked fine but suddenly the local exclude list doesn't work anymore.

Torrent
docker
octoprint/timelapse
octoprint/logs

my list looks like this but since today it started syncing the folders all the folders on the list. I didn't change anything. do you have a idea why it could happen?

Mixed Indentation

It seems that there is mixed indentation throughout the script, which makes it difficult to contribute.

Example

For example, lines 168-172 in cf3fc63 use 4 spaces to indent, while 173-180 uses a mixture of tabs and spaces.

Potential FIx

Whichever is preferred, I suggest a .editorconfig file to enforce. This can be automatically read by most editors and implemented automatically, so that nobody ever has to question it again!

This is how the .editorconfig file would look for 4-space indentation.

# EditorConfig is awesome: http://EditorConfig.org

# Top-Most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4

I'm happy to make a merge request making tabs/spaces consistent, and implementing the associated .editorconfig, if this (or if tabs!) is desired :)

Suggestion: Specifying Remote Directories

In the docs, it's not clear how to handle synchronization to target remote directories, i.e. https://docs.nextcloud.com/desktop/3.1/nextcloudcmd.html?highlight=nextcloudcmd#example

I was able to do this by specifying the full webdav path as the remote within the configuration file, but the docs imply that it's the URL of the nextcloud root:

# remote: https://nextcloud.example.com
remote: https://nextcloud.example.com/remote.php/webdav/<my-target-share>

Is there a better way to do this?

Otherwise, thanks!

missunderstanding of bash "-n" test in script?

I am a beginner in bash (but quite experienced in other shells). I think there might be a missuse in the sync script. The issue is that the script often uses the syntax "-n $XXX" , where $XXX is a shell variable. In the version of bash I am using [GNU bash, version 4.4.12(1)], it always returns returns true if it is invoked with just a variable name, which I dont think was intended. For example, the command

[ -n $XXX ]; echo $?

will always return 0, whether $XXX is defined or not, and whether it contains a string of length greater than 0. I think your intent using a -n test was often to check to make sure that variables have a valid filename, and if they do, to make use of it. In this case I think the correct syntax is to make the test check the contents of variable $XXX by putting double quote marks around it, so in my example you would use

[ -n "$XXX" ]; echo $?

In this case the check will echo 0 or 1, depending on whether $XXX has been defined. The original script failed when I tested it because I had not defined a "$UNSYNCEDFOLDERS" file and the script built a commandline with an unsyncfolders option containing an empty filename (and the nextcloudcmd command failed on a syntax error). When I added quote marks around the variable name things worked.

I am too inexperienced to be confident that I am correctly diagnosing the problem (but I think I got it right). Perhaps this will be useful

Phil

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.