Update crontab for everyone using iNotify
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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