pack files with timestamp
Moderators: Hacker, petermad, Stefan2, white
pack files with timestamp
Hi,
I have to archive my project very often and it is very useful if I have timestamp information (date and time) in filename like "myproject_2009_01_29_19_45.rar". Its tedious to add this information manually each time. Is it possible to automatise this process?
It is not important which archiver is used.
Thanks
Zoran
I have to archive my project very often and it is very useful if I have timestamp information (date and time) in filename like "myproject_2009_01_29_19_45.rar". Its tedious to add this information manually each time. Is it possible to automatise this process?
It is not important which archiver is used.
Thanks
Zoran
- theosdikaios
- Senior Member
- Posts: 228
- Joined: 2006-02-04, 13:02 UTC
IIRC there is no feature in Total Commander for your task. I made a button with help of cmd.exe feature of %date%. Because the format of %date% depends on your country settings maybe you need to change my example.
%date% gives me "dd/mm/yyyy"
My example produce a zip file "yymmdd.zip"
%Date:~3,2% returns "mm" (after 3rd position 2 letters)
You can do it with %time% in a similar way.
EDIT: There is another thread about this topic
Does TC have Date Parameter
%date% gives me "dd/mm/yyyy"
My example produce a zip file "yymmdd.zip"
%Date:~3,2% returns "mm" (after 3rd position 2 letters)
You can do it with %time% in a similar way.
Code: Select all
TOTALCMD#BAR#DATA
cmd /c start %ProgramFiles%\WinRAR\WinRAR.exe a %Date:~-2,2%%Date:~3,2%%Date:~0,2%.ZIP
@%L
%ProgramFiles%\WinRAR\WinRAR.exe
Pack marked files into yymmdd.zip
-1
Does TC have Date Parameter
"Since there are many things which have never happened and never will happen,
and which nevertheless are clearly conceivable, and imply no contradiction,
how can one say they are absolutely impossible?" Leibniz
and which nevertheless are clearly conceivable, and imply no contradiction,
how can one say they are absolutely impossible?" Leibniz
It sounds like a good idea, but I'm not sure what should I do with the code you have provided. I have tried to create a submenu item, but I was not sure which part of the code belongs to specific fields that should be provided. Could you give me some more details how to make this work?
It is also possible to make this with some other tool, like WinRar or WinZip if it already exists there.
Thanks
It is also possible to make this with some other tool, like WinRar or WinZip if it already exists there.
Thanks
2jeremycod
The code is the clipboard content of a TCmd-button. Mark the whole content of the "code" and copy to clipboard (CTRL+C). Then a right click in Tcmd button bar choose "Paste". Now you should have got a new button.how to make this work?
Thats the simpliest way e.g. using WinRAR switch "-ag". Do you need a free WinRAR licence? If so, search for "winrar free licence"?It is also possible to make this with some other tool, like WinRar or WinZip if it already exists there
Thank you norfie. When thying to resolve how to use switches in WinRAR I found that it is possible to setup backup to add datetime stamp as default, so it adds it each time I make an archive with WinRAR. It's works for me.Thats the simpliest way e.g. using WinRAR switch "-ag". Do you need a free WinRAR licence? If so, search for "winrar free licence"?It is also possible to make this with some other tool, like WinRar or WinZip if it already exists there
Thank you all for help.