Controlling AutoFileSync with AI
An AI assistant that may run commands on your computer can set up and change synchronisations and control the background service. Here you find a ready-made skill for that and prompts to try.
What AI control gives you
Say it instead of clicking
You describe in one sentence what is to be backed up. The AI enters source, target, template, schedule and exclusions – you do not need to know the program's options.
Find errors faster
The AI reads the state and the log of the service and tells you in your own language why a backup is not running – for instance because the disk is not plugged in.
Many changes in one go
The same exclusion in every synchronisation, a new schedule for five backups: one request instead of many dialogs.
Checks without looking
If your AI program can run a prompt regularly, it checks the service and the synchronisations and speaks up only when something is wrong.
You keep the last word: the AI shows every change before it writes, and a backup copy of the configuration is made before every write.
Risks: privacy and control
AI control is convenient, but not without risk. Read this before you set up the skill.
- Data leaves your computer: what the AI reads goes to its provider – the names and paths of your synchronisations, computer names and lines from the log. The scripts do not read the content of your files. AutoFileSync itself still sends nothing.
- Names alone reveal something: paths and log lines can contain the names of people, customers or projects. That, too, is personal or confidential data.
- The provider has a say: where the data is processed, how long it is kept and whether it is used for training depends on the provider, your contract and your settings. Check this beforehand. If you handle other people's data at work, first find out whether you may use the AI program for it.
- The AI can do more than the skill intends: an AI program that runs commands acts with your rights. The skill is an instruction, not a technical barrier – the AI could also read other files and send their content to the provider. Approve commands one by one rather than wholesale, and read what is about to be run.
- It also works without passing anything on: both scripts can be run in a terminal without any AI, and the assistant built into AutoFileSync runs entirely on your computer.
What you need
- AutoFileSync version 0.6.0 or later with the background service set up.
- Python 3 – usually present on Linux and macOS, for Windows from python.org.
- An AI program that can load skills and run commands on your computer, for example Claude Code. A chat in the browser is not enough.
ZIP file with the instructions for the AI (SKILL.md, in English) and two Python scripts · GNU GPL v3
What the AI can do with it
- Look: list all synchronisations with source, target and the result of the last run, and read warnings and errors from the log of the service.
- Set up: create a synchronisation – back up a folder, mirror it, or keep two folders the same – also to a server or cloud storage whose connection already exists in the program.
- Change: set exclusions, schedule, pause and options, switch a synchronisation off and on again, or remove it from the list.
- Control the service: query its state, start and stop it. A running service takes a changed configuration over by itself, within about a second.
How to set it up
- Download the ZIP file and unpack it. The folder autofilesync belongs in the skills directory of your AI program; for Claude Code that is .claude/skills in your home directory.
- Close the AutoFileSync window. The background service keeps running.
- Start the AI program and begin with a question that changes nothing – for example the first prompt below.
- Before every change the AI shows what it would enter. Read it, and only then confirm.
Example prompts
Names and paths are examples; put in your own.
Looking
Which synchronisations are set up in AutoFileSync, and when did each last run without errors?
Is the AutoFileSync background service running? Show me the warnings and errors from the log.
Why is “Photos” no longer being backed up?
Setting up and changing
Back up my Documents folder to the USB disk at /media/backup/Documents. Earlier versions should be kept. Show me first what you would enter.
The backup “Photos” should only run at night between 10 pm and 6 am, Monday to Friday.
In “Projects”, exclude the folders node_modules and all *.tmp files.
Switch “Videos” off for now without deleting it.
Controlling the service
Stop the AutoFileSync background service, I am about to unplug the backup disk.
Start the background service again and check after a minute whether all synchronisations have run.
Checking regularly
Check AutoFileSync: is the service running? Are there synchronisations with errors, or ones whose last error-free run is more than two days old? Answer only if something is wrong. Change nothing.
What the skill contains
The file SKILL.md tells the AI what it may and may not do. The work is done by two scripts, which can also be run in a terminal without any AI:
python3 scripts/afs_config.py list
python3 scripts/afs_config.py show "Photos"
python3 scripts/afs_config.py accounts
python3 scripts/afs_config.py add --name "Photos" --source ~/Pictures --target /media/backup/Pictures --template backup --dry-run
python3 scripts/afs_config.py set "Photos" schedule=22:00-06:00 days=mo,tu,we,th,fr --dry-run
python3 scripts/afs_config.py set "Photos" exclusions="*.tmp|Thumbs.db"
python3 scripts/afs_config.py disable "Photos"
python3 scripts/afs_config.py remove "Photos" --dry-run
python3 scripts/afs_service.py status
python3 scripts/afs_service.py start | stop | restart
python3 scripts/afs_service.py log --lines 40 --level warning
Every changing command takes --dry-run: it shows the change and writes nothing. On Windows the call is python instead of python3.
What you should know
- Never let the AI edit the configuration file directly. The file repeats the same key for every synchronisation; common JSON tools keep only the last of them, and the other synchronisations would be lost. The scripts of the skill keep every entry.
- The program window must be closed for changes. It keeps the configuration in memory and would overwrite the AI's change with its next save. The script therefore does not write while the window is open.
- Before every write the script puts a copy of the configuration next to it (autofilesync.json.before-ai-…); the last five are kept.
- The AI does not see passwords: they are stored encrypted in the file, and the script hides them. New connections to servers, cloud storage, phones and computers are still created in the program; the AI can use existing ones.
- Options that delete files – mirroring, two-way synchronisation, deleting the source after copying – are, according to the skill, only to be set after your explicit consent. An AI can be wrong: check source and target before you agree.
The assistant built into AutoFileSync is something else: it runs entirely on your computer, answers questions about the program and proposes changes that you confirm in the dialog. It does not need this skill.