Allow backup file name prefix to be specified via command line arg.

This commit is contained in:
prpr 2024-02-12 11:32:45 +00:00
parent 788652b289
commit ba8786f0db
1 changed files with 6 additions and 1 deletions

View File

@ -10,9 +10,14 @@ set dir "/mod/var/backup"
httpheader
set prefix "auto"
if {$argc > 0} {
set prefix [lindex $argv 0]
}
set now [clock seconds]
set file [file tail [cgi_get file \
[clock format $now -format "auto-%Y-%b-%d-%H:%M"]]]
[clock format $now -format "$prefix-%Y-%b-%d-%H:%M"]]]
if {[string match {auto-*} $file]} {
# Delete any old automatic backups.