Jump to content
Sign in to follow this  
Rogue5099

Saving logs to .rar?

Recommended Posts

Rogue5099

I made this to delete the log files I have and make new to replace, but I would like to actually store them as .rar files instead of deleting them. Have it save the file as that days date and time. I have looked through posts and search files just to do this script but saw nothing on saving as .rar but I did see something about this _Date_Time_SystemTimeToFileTime. Currently it is ran in the directory that the files are in cause I have several that I use. Any help would be great!

#include <File.au3>

Global $AwesomERR = "\Awesom-O.err"
Global $AwesomO = "\Awesom-O.log"
Global $Dump = "\Dumping.log"
Global $games = "\games.txt"
Global $ID = "\Identifying.log"
Global $Pick = "\Picking.log"
Global $Sell = "\Selling.log"
Global $Stash = "\Stashing.log"


FileRecycle (@ScriptDir & $AwesomERR)
FileRecycle (@ScriptDir & $AwesomO)
FileRecycle (@ScriptDir & $Dump)
FileRecycle (@ScriptDir & $games)
FileRecycle (@ScriptDir & $ID)
FileRecycle (@ScriptDir & $Pick)
FileRecycle (@ScriptDir & $Sell)
FileRecycle (@ScriptDir & $Stash)
MsgBox(4096, "Notice", "Awesom-O log files have been deleted to Recycle Bin")

_FileCreate(@ScriptDir & $AwesomERR)
_FileCreate(@ScriptDir & $AwesomO)
_FileCreate(@ScriptDir & $Dump)
_FileCreate(@ScriptDir & $games)
_FileCreate(@ScriptDir & $ID)
_FileCreate(@ScriptDir & $Pick)
_FileCreate(@ScriptDir & $Sell)
_FileCreate(@ScriptDir & $Stash)

Exit

Share this post


Link to post
Share on other sites
Zedna

File name based on Today's date:

$name = StringRight(@YEAR,2) & '-' & @MON & '-' & @MDAY & '.rar'

As for RAR: There are posts on the forum about using unrar.dll

but for creating RAR archive the best will be call rar.exe by RunWait()

Share this post


Link to post
Share on other sites
Rogue5099

Thanks for your help but this is actually my first autoit script I am starting myself. I have edited others and that has worked out ok but doing this from scratch is a little challanging. I'm getting nowhere with RunWait or trying the the plugin (cause I'm retared lol). I'll see what I can work with, any other help feel free to send it my way!

-Edit .zip would work too I guess!!

Edited by rogue5099

Share this post


Link to post
Share on other sites
Rogue5099

Advice number one: Always use AutoIt helpfile

There is no helpfile for this .zip plugin??? Having a hard time just creating a .zip file! Much less naming it and adding files to it. trying functions but no luck right now just errors... fixing them 1 at a time!

Share this post


Link to post
Share on other sites
nobbe

hi

you could use the internal rar function to name the rar file to current time / date

rar a -agDD_MM_YYYY_HHMM c:\backups *.log

with autoit

$rc= Runwait("rar a -agDD_MM_YYYY_HHMM c:\backups *.log")

Edited by nobbe

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×