nextcloud / nextcloud/vm

Update crontab for everyone using iNotify

Open
#2,421 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Ready for testing
Dominant language
Shell
Stars
1.6k
Forks
671
Avg merge
15h 52m
Merged PRs (30d)
4

Description

This piece of code would update the crontab for everyone using the SMB mount app. Problem is that it's not fail proof to get the actual MOUNT_IDs so it's better to do it manually.

source /var/scripts/fetch_lib.sh

# Replace iNotify checker with a script instead
if crontab -u www-data -l | grep -q "files_external:notify -v"
then
    download_script ADDONS notify-crontab
    chmod +x "$SCRIPTS"/notify-crontab.sh
    chown root:root "$SCRIPTS"/notify-crontab.sh
    MOUNT_ID=$(sudo -u postgres psql nextcloud_db -c "select mount_id from oc_external_config")
    crontab -u www-data -l | grep -v "files_external:notify -v" | crontab -u www-data -
    crontab -u root -l | { cat; echo "@reboot $SCRIPTS/notify-crontab.sh $(echo "${MOUNT_ID##*  }" | head -1)"; } | crontab -u root -
    print_text_in_color "$ICyan" "Replaced  iNotify with a script instead of command."
fi

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the SMB mount update logic that sources /var/scripts/fetch_lib.sh and handles notify-crontab.sh. Check how the MOUNT_ID is obtained and how crontab entries are changed for www-data and root. Done means the iNotify command is replaced reliably without depending on an automatic, potentially incorrect MOUNT_ID.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, shell
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.