{"id":26020686,"url":"https://github.com/flohoss/gocron","last_synced_at":"2025-04-05T09:04:47.426Z","repository":{"id":279317562,"uuid":"938378138","full_name":"flohoss/gocron","owner":"flohoss","description":"A go based task scheduler with GUI","archived":false,"fork":false,"pushed_at":"2025-03-23T00:04:24.000Z","size":14203,"stargazers_count":219,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T08:02:50.460Z","etag":null,"topics":["backup","backups","cron","docker","golang","schedule","scheduler","task","vue"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flohoss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-24T21:28:31.000Z","updated_at":"2025-03-28T11:09:38.000Z","dependencies_parsed_at":"2025-02-25T00:29:22.816Z","dependency_job_id":"67614565-fc47-4491-955c-f2b518445050","html_url":"https://github.com/flohoss/gocron","commit_stats":null,"previous_names":["flohoss/gocron"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flohoss%2Fgocron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flohoss%2Fgocron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flohoss%2Fgocron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flohoss%2Fgocron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flohoss","download_url":"https://codeload.github.com/flohoss/gocron/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312068,"owners_count":20918344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","backups","cron","docker","golang","schedule","scheduler","task","vue"],"created_at":"2025-03-06T08:01:45.724Z","updated_at":"2025-04-05T09:04:47.399Z","avatar_url":"https://github.com/flohoss.png","language":"Go","funding_links":[],"categories":["Software","Go"],"sub_categories":["Automation"],"readme":"# GoCron\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"web/public/static/logo.webp\" height=\"250px\"\u003e\n\n[![goreleaser](https://github.com/flohoss/gocron/actions/workflows/release.yaml/badge.svg?branch=main)](https://github.com/flohoss/gocron/actions/workflows/release.yaml)\n[![GitHub go.mod Go version of a Go module](https://img.shields.io/github/go-mod/go-version/gomods/athens.svg)](https://github.com/flohoss/gocron)\n\nA task scheduler built with Go and Vue.js that allows users to specify recurring jobs via a simple YAML configuration file. The scheduler reads job definitions, executes commands at specified times using cron expressions, and passes in environment variables for each job.\n\n\u003c/div\u003e\n\n# Table of Contents\n\n- [Features](#features)\n- [How It Works](#how-it-works)\n- [Docker](#docker)\n  - [run command](#run-command)\n  - [compose file](#compose-file)\n- [Screenshots](#screenshots)\n  - [Home](#home)\n  - [Job](#job)\n  - [Installed software](#installed-software)\n  - [OpenAPI Specification (/api/docs)](#openapi-specification-apidocs)\n- [Example Configuration](#example-configuration)\n- [Preinstalled Software](#preinstalled-software)\n- [✨ Star History](#-star-history)\n- [License](#license)\n- [Development setup](#development-setup)\n  - [Automatic rebuild and reload](#automatic-rebuild-and-reload)\n  - [Rebuild types while docker is running](#rebuild-types-while-docker-is-running)\n\n## Features\n\n- Simple Configuration: Easily define jobs, cron schedules, and environment variables in a YAML config file.\n- Cron Scheduling: Supports cron expressions for precise scheduling.\n- Environment Variables: Define environment variables specific to each job.\n- Easy Job Management: Add and remove jobs quickly with simple configuration.\n- Pre-installed backup-software for an easy backup solution\n\n## How It Works\n\n- Defaults Section: This section defines default values that are applied to all jobs. You can specify a default cron expression and environment variables to be inherited by each job.\n- Jobs Section: Here, you define multiple jobs. Each job can have its own cron expression, environment variables, and commands to execute.\n- Environment Variables: Define environment variables for each job to customize its runtime environment.\n- Commands: Each job can have multiple commands, which will be executed in sequence.\n\n## Docker\n\n### run command\n\n```sh\ndocker run -it --rm \\\n  --name gocron \\\n  --hostname gocron \\\n  -p 8156:8156 \\\n  -e TZ=Europe/Berlin \\\n  # Delete runs from db after x days, disable with -1\n  -e DELETE_RUNS_AFTER_DAYS=7 \\\n  # Log level can be one of: debug info warn error\n  -e LOG_LEVEL=info \\\n  -e PORT=8156 \\\n  # Check apprise for supported services (https://github.com/caronc/apprise?tab=readme-ov-file#supported-notifications)\n  # -e APPRISE_URL=ntfys://{token}@{hostname}/{topics} \\\n  # one of: debug info warn error\n  # -e APPRISE_NOTIFY_LEVEL=warn \\\n  -v ./config/:/app/config/ \\\n  # Uncomment if using Restic with a password file\n  # -v ./.resticpwd:/secrets/.resticpwd \\\n  # Uncomment if using a preconfigured rclone config\n  # -v ./.rclone.conf:/root/.config/rclone/rclone.conf \\\n  # Uncomment to allow running Docker commands inside the container\n  # -v /var/run/docker.sock:/var/run/docker.sock \\\n  ghcr.io/flohoss/gocron:latest\n```\n\n### compose file\n\n```yml\nservices:\n  gocron:\n    image: ghcr.io/flohoss/gocron:latest\n    restart: always\n    container_name: gocron\n    hostname: gocron\n    environment:\n      - TZ=Europe/Berlin\n      # Delete runs from db after x days, disable with -1\n      - DELETE_RUNS_AFTER_DAYS=7\n      # Log level can be one of: debug info warn error\n      - LOG_LEVEL=info\n      - PORT=8156\n      # Check apprise for supported services (https://github.com/caronc/apprise?tab=readme-ov-file#supported-notifications)\n      # - APPRISE_URL=ntfys://{token}@{hostname}/{topics}\n      # one of: debug info warn error\n      # - APPRISE_NOTIFY_LEVEL=warn\n    volumes:\n      - ./config/:/app/config/\n      # Uncomment if using Restic with a password file\n      # - ./.resticpwd:/secrets/.resticpwd\n      # Uncomment if using a preconfigured rclone config\n      # - ./.rclone.conf:/root/.config/rclone/rclone.conf\n      # Uncomment to allow running Docker commands inside the container\n      # - /var/run/docker.sock:/var/run/docker.sock\n    port:\n      - '8156:8156'\n```\n\n## Screenshots\n\n### Home\n\n\u003cimg src=\"img/home.webp\" width=\"500px\"\u003e\n\n\u003cimg src=\"img/home_light.webp\" width=\"500px\"\u003e\n\n### Job\n\n\u003cimg src=\"img/job.webp\" width=\"500px\"\u003e\n\n\u003cimg src=\"img/job_light.webp\" width=\"500px\"\u003e\n\n### Installed software\n\n\u003cimg src=\"img/software.webp\" width=\"500px\"\u003e\n\n\u003cimg src=\"img/software_light.webp\" width=\"500px\"\u003e\n\n### OpenAPI Specification (/api/docs)\n\n\u003cimg src=\"img/api.webp\" width=\"500px\"\u003e\n\n\u003cimg src=\"img/api_light.webp\" width=\"500px\"\u003e\n\n## Example Configuration\n\nThe following is an example of a valid YAML configuration creating backups with restic every 3 am in the morning and cleaning the repo every Sunday at 5 am:\n\n```yml\ndefaults:\n  # every job will be appended to this cron and the jobs will run sequentially\n  cron: '0 3 * * *'\n  # global envs to use in all jobs\n  envs:\n    - key: RESTIC_PASSWORD_FILE\n      value: '/secrets/.resticpwd'\n    - key: BASE_REPOSITORY\n      value: 'rclone:pcloud:Server/Backups'\n    - key: APPDATA_PATH\n      value: '/mnt/user/appdata'\n\njobs:\n  - name: Cleanup\n    # override the default cron\n    cron: '0 5 * * 0'\n    # envs just for the job, overwriting exiting defaults\n    envs:\n      - key: RESTIC_POLICY\n        value: '--keep-daily 7 --keep-weekly 5 --keep-monthly 12 --keep-yearly 75'\n      - key: RESTIC_POLICY_SHORT\n        value: '--keep-last 7'\n    commands:\n      - command: restic -r ${BASE_REPOSITORY}/forgejo forget ${RESTIC_POLICY} --prune\n      - command: restic -r ${BASE_REPOSITORY}/paperless forget ${RESTIC_POLICY} --prune\n  - name: Forgejo\n    envs:\n      - key: RESTIC_REPOSITORY\n        value: ${BASE_REPOSITORY}/forgejo\n    commands:\n      - command: docker exec -e PASSWORD=password forgejo-db pg_dump db --username=user\n        file_output: ${APPDATA_PATH}/forgejo/.dbBackup.sql\n      - command: restic backup ${APPDATA_PATH}/forgejo\n  - name: Paperless\n    envs:\n      - key: RESTIC_REPOSITORY\n        value: ${BASE_REPOSITORY}/paperless\n    commands:\n      - command: docker exec paperless document_exporter ${APPDATA_PATH}/paperless/export\n        file_output: ${APPDATA_PATH}/paperless/.export.log\n      - command: restic backup ${APPDATA_PATH}/paperless\n  - name: Show files\n    # only a command per job is required\n    commands:\n      - command: ls -la\n```\n\n## Preinstalled Software\n\nThese tools are preinstalled and ready to be used for various operations within your jobs:\n\n1. [BorgBackup](https://www.borgbackup.org/)\n\n\u003e BorgBackup is a fast, secure, and space-efficient backup tool. It deduplicates data and can be used for both local and remote backups. It is widely known for its encryption and compression capabilities, which ensures that backups are both secure and compact.\n\n2. [Restic](https://restic.net/)\n\n\u003e Restic is a fast and secure backup program that supports various backends, including local storage and cloud providers. Restic is optimized for simplicity and speed, offering encrypted backups with minimal configuration. It integrates perfectly with the task scheduler for managing secure backups.\n\n3. [rclone](https://rclone.org/)\n\n\u003e rclone is a command-line program used to manage and transfer files to and from various cloud storage services. It supports numerous cloud providers, including Google Drive, Dropbox, and Amazon S3, making it an excellent choice for managing backups on remote storage solutions. With rclone, you can efficiently sync, move, and manage your data in the cloud.\n\n4. [rsync](https://rsync.samba.org/)\n\n\u003e rsync is a fast and versatile file-copying tool that efficiently synchronizes files and directories between local and remote systems. It uses delta encoding to transfer only changed parts of files, making it an excellent choice for incremental backups and remote file synchronization over SSH.\n\n5. [curl](https://curl.se/)\n\n\u003e curl is a command-line tool for transferring data using various network protocols, including HTTP, HTTPS, FTP, and SFTP. It is widely used for downloading files, interacting with APIs, and automating data transfers in scripts.\n\n6. [rdiff-backup](https://rdiff-backup.net/)\n\n\u003e rdiff-backup is an incremental backup tool that efficiently maintains a full backup of the latest data while preserving historical versions in a space-efficient manner. It is ideal for remote and local backups, combining the best features of rsync and traditional incremental backup methods.\n\nLet me know if you’d like any modifications! 🚀\n\n## ✨ Star History\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=flohoss/gocron\u0026type=Date\u0026theme=dark\" /\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=flohoss/gocron\u0026type=Date\" /\u003e\n  \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=flohoss/gocron\u0026type=Date\" /\u003e\n\u003c/picture\u003e\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/flohoss/gocron/blob/main/LICENSE) file for details.\n\n## Development setup\n\n### Automatic rebuild and reload\n\n```sh\ndocker compose up\n```\n\n### Rebuild types\n\n```sh\n# Run docker compose up first for the types to be generated\n\ndocker compose run --rm types\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflohoss%2Fgocron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflohoss%2Fgocron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflohoss%2Fgocron/lists"}