Comments (6)
I just came across this to try and debug why my tests weren't working (I need to trigger a job immediately after an upload to post-process data). Then I changed the logging to DEBUG and noticed that it takes a long time before the cron is run (hour or so?).
As a workaround, is there a hint where in the sources I might be able to workaround this to trigger immediately? I'm not a PHP dev (but do develop in C for embedded), so some guidance would be appreciated.
As in the original request, it could be useful if there's a description how to trigger this from the command line (so I can put in my own cronjob).
from workflow_script.
Then I changed the logging to DEBUG and noticed that it takes a long time before the cron is run (hour or so?).
from workflow_script.
For testing it would be great if one could trigger it from within the web interface.
You still need to force an event as configured to happen. Assumed it is there, hypothetically we can show a button to run an enqueued job perhaps. Alas it should be decoupled from the web request process for it might get in trouble on timeouts.
Alternatively it should be documented how to do through a terminal (=> call cron.php)
That's fair and probably best to achieve as you likely be on the system anyway when setting up this flow/script.
from workflow_script.
Thanks for the pointer to the server docs, I did find them too, and it does help them being here.
I've playing around how to get this to work. I set up the background jobs using 'cron' with systemd. It runs, and I can now see my scripts run (the md5sum is generated) also by setting the logging to DEBUG in the config file. Are there any limitations to what can be done in the script? The output of the script is next to the original file, and so it appears in the Files tab, I want to trigger "occ" to scan for files (works when done manually on the commandline), but for some reason, this doesn't appear to have any effect in the script itself.
e.g.
#
# Usage from NextCloud:
# /opt/scripts/md5sum.sh %a %n
NEXTCLOUDDATA=/var/www/nextcloud/data
if [ ! -d $NEXTCLOUDDATA/$1 ]; then
echo "USER $1 not found. Aborting" >> /tmp/mdlog.txt
exit 1;
fi
if [ ! -f $NEXTCLOUDDATA/$2 ]; then
echo "PATH $2 not found. Aborting" >> /tmp/mdlog.txt
ls -l $NEXTCLOUDDATA >> /tmp/mdlog.txt
ls -l $NEXTCLOUDDATA/$2 >> /tmp/mdlog.txt
exit 1;
fi
echo "USER $1 PATH $2 execution" >> /tmp/mdlog.txt
INPUTFILE=$NEXTCLOUDDATA/$2
md5sum $INPUTFILE > $INPUTFILE.md5sum.txt
echo "Running Script Update" >> /tmp/mdlog.txt
ls -l $INPUTFILE* >> /tmp/mdlog.txt
/usr/bin/php -f /var/www/nextcloud/occ files:scan $1 >> /tmp/mdlog.txt
echo "DONE" >> /tmp/mdlog.txt
I don't see the "DONE" in the output (but everything else before the call to PHP). The newly generated file is not shown so it doesn't look like occ files:scan $1 (user) worked.
Really appreciate your pointers.
from workflow_script.
Works for me. Perhaps scanning takes too long for you?
You can only scan the new file, instead of everything, that should speed up things.
# ...
RELFILE="$2.md5sum.txt"
/usr/bin/php -f /srv/http/nextcloud/master/occ files:scan -p "$RELFILE" -- $1 >> /tmp/mdlog.txt
# ...
from workflow_script.
As there is no feedback since a while I will close this ticket. If this is still happening please feel free to reopen.
from workflow_script.
Related Issues (20)
- %n parameter is broken on GROUP FOLDERS HOT 3
- Add Support for nextcloud 24 HOT 8
- Does the App follow semantic versioning? HOT 3
- add support für Nextcloud 25 HOT 2
- Fix lang resource not appearing on Transifex please HOT 2
- NC 24.x to 25.0.2,25.0.3,25.0.4 HOT 3
- Replace lint.yml with split workflows
- ffmpeg throwing "Invalid data found when processing input" HOT 3
- Update to 1.11.0: Failed opening required '/PATH/apps/workflow_script/composer/../vendor/autoload.php' in occ
- Adding a watermark to PDF files in Nextcloud HOT 1
- placeholder %i is not replaced because of wrong replacement of %s HOT 1
- Only 5 Tags available for Tag trigger HOT 1
- View::getLocalFolder() was removed HOT 1
- error when updating from 20.0.2 to 20.0.14 HOT 1
- Script is not executed with automatically assigned keyword HOT 1
- Add scripts management UI
- `shell_exec(): Unable to execute` HOT 2
- Just some question about the app… HOT 1
- [Feature request] Add display name as placeholder HOT 2
- Failed to update nextcloud/ocp package on branch stable28
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from workflow_script.