forked from hummypkg/webif
Allow backup file name prefix to be specified via command line arg.
This commit is contained in:
parent
788652b289
commit
ba8786f0db
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue