TFTP Server: move timestamped Cisco config backups into a folder per device

6 posts

Andreas Guest
21 Sep

Hello SoftPerfect Support,

I am currently using SoftPerfect TFTP Server for automated Cisco configuration backups.
I would like to ask whether it is possible to configure the TFTP Server to automatically move timestamped backup files into device-specific subdirectories.

My current setup works as follows:

A Cisco device pushes its configuration to the TFTP server, for example:
SW01-confg
If SW01-confg already exists, SoftPerfect TFTP Server renames the existing file using the timestamp option. This results in something like:

SW01-confg.20260915-111728

The new configuration is then saved as:
SW01-confg

This part works perfectly.

What I would like to achieve is that the timestamped file is automatically moved to a separate archive directory, with a subdirectory for each device.

For example:

D:\TFTPboot\
SW01-confg
SW02-confg

D:\TFTPold\
SW01\
SW01-confg.20260918-090512
SW01-confg.20260918-101530

SW02\
SW02-confg.20260918-091200

In other words, whenever SoftPerfect creates a timestamped file such as:

SW01-confg.20260918-090512

I would like it to be automatically moved to:

D:\TFTPold\SW01\SW01-confg.20260918-090512

The device name is everything before -confg.

Is there a built-in feature, rule, variable, script hook, or event action in SoftPerfect TFTP Server that would allow this?
Ideally, I would like to achieve this without running a separate file-monitoring application.

Thank you for your help.

Best regards
Andreas

Andrew SoftPerfect
21 Sep

There's nothing built in for this yet, so for now it would need an external file watcher. But it fits something we've been thinking about, so let me run the idea past you.

We'd add an optional "after upload" hook: you point the server at a script of your own, and it runs once per completed upload with the file it just received, the device's IP and the full path of the timestamped file it renamed out of the way. That last one is the bit you need. Your script would get D:\TFTPboot\SW01-confg.20260918-090512 directly, take the device name from it and move it wherever you like, in two or three lines and with nothing else running.

Would that cover it? If there's anything else you'd want passed to the script, now is a good time to say, while the design is still open.

Andreas Guest
21 Sep

Hello Andrew,

Thank you for the quick response.

Would it be possible to integrate the backup functionality directly into the SoftPerfect TFTP Server, so that no external PowerShell script or file watcher would be required?

Best regards,
Andreas

Andrew SoftPerfect
22 Sep

It's built in now, so you won't need a script or a file watcher after all. Instead of the hook I described, the server reads a rules file and does the work itself. It's in TFTP Server 26.10, on the TFTP Server page.

Open Settings, go to the Transfers page and click Post-processing rules. That opens TFTPRules.ini, which sits beside your TFTPServer.ini. It's fully commented, and the server re-reads it every time you save, so nothing needs restarting.

For your setup, add this:

[Rule.0]
Event = upload-complete
MatchType = regex
Match = ^(.+)-confg$
Action = move
Source = previous
Target = D:\TFTPold\{1}\{file}

Source = previous is the line that matters: the rule acts on the timestamped copy the server renamed out of the way, not on the new upload. Match is still tested against the uploaded name, so the brackets capture everything before -confg and {1} becomes SW01. {file} is the renamed file's own name, so SW01-confg.20260918-090512 ends up at D:\TFTPold\SW01\SW01-confg.20260918-090512, and any folders that don't exist yet are created for you.

Leave When file already exists on Rename with timestamp suffix as you have it now, since that's what produces the file the rule moves.

The label next to the button shows how many rules were loaded and, if one has a mistake in it, the line number to look at. Everything the rules do goes into the server log as well.

Andreas Guest
22 Sep

Hello Andrew,

Wow, what an outstanding service! I am absolutely thrilled.

To implement a custom feature request in a freeware product within just one day is incredibly generous and far beyond what anyone could expect. Thank you so much for your amazing effort and the swift support!

I have already installed the preliminary build, added the rule to TFTPRules.ini, and tested it.
It works perfectly! The timestamped files are automatically and flawlessly moved into the device-specific subdirectories, just as requested. Thank you again for this brilliant update.

This makes our Cisco backup process so much easier.

Best regards,
Andreas

Andrew SoftPerfect
22 Sep

Thanks for letting me know, good to hear it works :)

You described a real setup precisely enough that there was something definite to build against, which is rarer than you'd think. The rules are part of the public release now, TFTP Server 26.10, so there's no need to stay on the preliminary build.

Reply
Shown with your post. Sign in to keep the same name every time.
(optional, never shown)
Only needed if you want notifications about replies.
Drag files here, paste a screenshot, or . Images up to 10 MB. Text, log and zip files up to 2 MB. Up to 5 files per post.
You can edit your post until someone replies.