Hello,
I have mineOS-node running since about a Week and things are working really well. I have one thing that bothers me though. Via scheduling, I started a cronjob to create an archive each day. The Backups are named server-servername-YYYY-MM-DD_HH:MM:SS. Since I run mine OS on an unRAID machine and I get to save the files on a windows pc, I’d like the archives to be named differently since Windows cannot handle “:” in filenames, so it just shows up in a cryptic way which makes organizing difficult. Is there any way to change the name that mineOS applies to its archives when they are created?
I appreciate any help !
I don’t think I’ve ever had that problem; but I think the filename generation’s hardcoded meaning you’d have to rename them yourself afterwards, either via the server or after downloading them. To rename them server-sided, you’d have to tamper with permissions which isn’t really advised, but using WinSCP on to download/transfer archives I’ve never had any problems with “invalid” characters/filenames with any folder/file.
1 Like
Thats because software like filezilla or winscp changes the : to _ to be able to keep the name this way. However, I access the archives via windows explorer network tab, since I have the mineOS archive folder mounted as a network drive. The names then appear like this: SZ24L3~5
Oh well.
Well, that’s Windows for you; lacking filesystem support and much more. However I think you should be able to modify the MineOS scripts in order to change the archive format to what you’d like it to be; I’m not entirely sure yet but there’s another recent post with info I might be able to use to figure out how to do so.
Ah I assume a cronjob renaming files to replace : with _ would work as well. I will test that
Edit: Yeah I just added a cron to my unRAID Server. I’ll have it run 20 mins after my archives get created, so when I wake up its all neat. If anyone’s interested, this is what I exectute via unraid scheduling:
#!/bin/bash
cd /mnt/disk3/appdata/minecraft/archive/FTB
for f in *:*; do mv -v "$f" $(echo "$f" | tr ':' '-'); done
echo Finished
of course the folder would need to be edited for you.
1 Like
Well here’s the MineOS script https://github.com/hexparrot/mineos-node/blob/master/html/js/scriptin.js also located in /usr/games/minecraft/html/js
; I’ve searched (Ctrl+F) for keywords like filename
, server
, servername
, archive
, etc but didn’t see anything you could change that’d change the archive formatting.
Cron jobs I think would be more complicated to do as you’d typically need to know the name of the file in the script (and with more than 1 file being in there I don’t think *
would work without trying to rename all to the same names or something, which wouldn’t work).
Edit: Well that seemed easy enough to create that cron script
Yeah I knew cron would help me out if it had to, but having the filenames right from the get go would have been even cleaner anyway, yeah I have created multiple archives and it works just fine. Thanks for your time though ! Its appreciated
1 Like
Thanks! Good to know in case I need to set it up again in the future. Since everything is working for me now with cron…never change a running system
Could we get this added to the repo, perhaps?
It wouldn’t break anything (assuming there’s nothing hard-corded relying on the archive name), and would mean wider compatibility with non-Linux systems.