I need you to generate a script that has the following requirements:

*HEADER*
Includes 
- date of generation 
- generated by Grok and your version 

*LANGUAGE*
Shell: Zsh

*PARAMETERS*
- a parameter name PERIOD_DAYS vwith a current 30 value
- 3 parameters ALLFILES_URL, ALLFILES_USER and ALLFILES_PASS that are loaded from a config file using jq
- a paramter for locating the config file
CONFIG_FILE="$(dirname "$0")/owncloud.json"

- a parameter GOG_ACCOUNT with a current current value of denis.etienne@gmail.com
- GOG_ACCOUNT must be exported (use EXPORT)
- a parameter EMAIL_RECIPIENT with a current current value of denis.etienne@gmail.com
- a parameter START_DATE which must be set to a date which is PERIOD_DAYS days before now
- a GOOGLE_DRIVE_QUERY parameter which must be set to "after:" concatenated with the value of START_DATE

*PROCESSING LOGIC*
The goal is to ensure files returned by Google drive query are also present in Owncloud, send an email report to highlight differences
- run "gog drive search $(GOOGLE_DRIVE_QUERY)" to fetch the results from the GOOGLE_DRIVE_QUERY
- run curl -s -f -v -u "${ALLFILES_USER}:${ALLFILES_PASS}" "${ALLFILES_URL}" to fetch the list of files from Owncloud
- note the owncloud files are returned one per line with format : filename+'|'+modification_date
- check if each files coming from GOOGLE_DRIVE is present in OwnCloud (otherwise use MISSING in the report)
- check if each files coming from GOOGLE_DRIVE is more recent in OwnCloud (otherwise use NEED UPDATE in the report)
- generate a REPORT as described below

*REPORT*
- Sending is done using gog mail send --to "$EMAIL_RECIPIENT" --subject "OwnCloud Sync Report" --body-file "$REPORT_FILE"
- The report must also contain the time and date of the run
- The time elapsed during the full production of the report, including the Sending

*FORMAT*
- Owncloud files list has a very clear format, using | as separator
- Owncloud files list excerpt: Introducing ownCloud.pdf|2022-10-29 22:40
- Be careful : Google drive returns more than just a filename and a date, the challenge is to extract clean filename and date

*CAVEAT*
- When you will compare filenames from Google Drive, you must be especially careful with space and tabs that Google Drive could send.
- Expect there will be issues with spaces and tabs in filenames, so foresee DEBUG messages for file "facture internat Q1 2026.pdf" to show hexa code for each chars when it comes from Owncloud, or from Google Drive

GO!

