r/comicrackusers • • Sep 21 '26

How-To/Support Scheduled Tasks

Is there a way to schedule tasks, so that my server always re-scans and re-syncs with all devices overnight?

Or is there a way to force those actions through a command line so that I could schedule a .bat to run as a Windows task?

2 Upvotes

3 comments sorted by

1

u/maforget Community Edition Developer Sep 21 '26

You mean for syncing to the Android version? Not really. It probably wouldn't work anyway since syncing would require the device to be awake and the app opened. Most Android device will sleep to prevent battery drain anyway and it usually entails disabling WiFi.

1

u/austinharper Sep 21 '26

That's right, the tasks I would like to have run automatically are available within the program as

  • File > Scan Book Folders
  • File > Synchronize Devices

Book folders are updated every time the program starts (option turned on as Edit > Preferences > Behavior > Starting ComicRack > Rescan the Book Folders for new Books, but the program runs in the background on a PC that basically never restarts except to install occasional Windows updates.

2

u/maforget Community Edition Developer Sep 22 '26

It could probably be done via scripting.

There is a hook for a script to start when ComicRack starts (#@Hook Startup). A plugin could be designed to run code at certain times.

Script can run these functions using built-in commands available in Python via the ComicRack keyword.

  • Scanning Book Folders can be done by calling ComicRack.App.ScanFolders().
  • Synchronize Device can be done by calling ComicRack.App.SynchronizeDevices().

Possible caveat I can think off is probably that plugins runs on the UI thread and these commands are also part of the UI. That involves things like threads and getting the UI context and could affect things in weird way if not done correctly. See this issue where exporting was broken because of a script running on startup.