qcif / nextcloud-sync-cron Goto Github PK
View Code? Open in Web Editor NEWCron job script for running the Linux/Unix Nextcloud command line client
License: MIT License
Cron job script for running the Linux/Unix Nextcloud command line client
License: MIT License
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.
Hi! great work :),
Would be possible to add the parameter --uplimit to the nextcloudcmd in the config file?
Thank you!
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?
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?
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?
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,
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
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!
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
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
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.
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?
It seems that there is mixed indentation throughout the script, which makes it difficult to contribute.
For example, lines 168-172 in cf3fc63 use 4 spaces to indent, while 173-180 uses a mixture of tabs and spaces.
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 :)
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!
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
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
I'm using nextcloudcmd version 3.5.4 where --davpath option is now --path.
I had to change line 559 in the script from davpath to path and then everything worked as expected.
best regards
benny
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.