#171101 - 2006-12-06 02:09 PM
Re: Directory creation based on date issue
[Re: Glenn Barnas]
|
Pax
Getting the hang of it
Registered: 2006-12-01
Posts: 51
|
If you don't fix the date string to include leading zeros as Alan suggested, you won't be able to tell the difference betweeen 2007121 (January 21) and 2007121 (December 1), assuming you keep your archives that long. Also, it makes the dates all 8 char strings, not something between 6 and 8, which makes sorting easier.
Glenn Hey Glenn,
I've taken the script NTDOC (Is this Alan?) and he redefined the $Archive value correctly, and this value is used to create the directory and to move, create and expand the files correctly.
We are only keeping the files for 3 months, but since the issue is resolved, it should not pose a problem.
Pax
|
Top
|
|
|
|
#171160 - 2006-12-07 06:22 AM
Re: Directory creation based on date issue
[Re: Glenn Barnas]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
|
|
Top
|
|
|
|
#171165 - 2006-12-07 11:16 AM
Re: Directory creation based on date issue
[Re: Les]
|
Pax
Getting the hang of it
Registered: 2006-12-01
Posts: 51
|
Would it be possible to steer clear of which Alan/Allen/Allan/Alen is which for 2.5 seconds, and I was getting confused as to where this thread was going?? I understand what NTDOC did, but yes explaining it for the masses who don't understand what I do now is a great benefit for this thread.
Back to post #171095
I just had another thought on your suggestion about the WRITELINEs I seem to be doing everywhere.
Would it be a better choice to open the logfile, and immediately below it use PHP: RedirectOutput($ARCHIVELOG)
and remove the WRITELINE commands? This would mean I could capture the output from Blat, RAR and UNRAR directly to the log file, as I think this would be served well in the file.
The benefits would be that if there are problems, then I can just comment out that line and see it on screen running it manually. Also the script would be smaller and easier to diagnose if problem turn up instead of having screen output and log file output seperately?
Ideas?
Pax
I got a comment confirming that RedirectOutput does mean nothing will appear on the console, which is fine as this will run as a scheduled task, BUT, is this the better method than having comments and errors echoing to screen, and again writing them to the file.
It would just down on the script size, and possible mean less errors as there is less code for me to leave out a rogue ",),; mark??
Pax
EDIT: Answered my own questions partially by trying it, but I still have the problem with redirecting RAR and UNRAR output as using >> tell me that it doesn't understand the command, so I'm exploring using the option -ierr which re-directs to STDERR.
It will need refining more, but I'll post here when I am happy enough for it to go into production.
Because I am trying to email the log file using blat, I have found that I have to do a RedirectOutput("") before emailing the file to close the file, otherwise the file cannot be accessed to it being help open. It is an issue with blat, but at least I can work around it.
Edited by Pax (2006-12-07 02:19 PM)
|
Top
|
|
|
|
#171173 - 2006-12-07 03:20 PM
Re: Directory creation based on date issue
[Re: Pax]
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
the @-sign in strings should not be doubled if NoMacrosInStrings is On
...
$SO=SetOption('NoMacrosInStrings','On')
...
$Sender = 'sender@emailserver.net'
$SupportEmail = 'support@emailserver.net'
$EmailAddress = 'recipient@emailserver.net'
...
|
Top
|
|
|
|
#171192 - 2006-12-07 09:12 PM
Re: Directory creation based on date issue
[Re: Pax]
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
1. I'm the one using the PHP tag a lot as it looks and formats nice on the board.
2. I would use store what I want to see in a log file to VARS then write at the end.
3. In order to see the output from RAR you would need to launch from %comspec% first and then make sure you end the RAR command, then redirect.
4. Sorry for the "syntax" errors, but I did not write the whole script as though it were going to be in production by myself.
5. Sorry to go "off topic" but pretty much it was assumed your concerns were answered and the rest was in good fun (this is not a business and all are here as volunteers).
6. The explanation is "ON TOPIC" regardless of other noise in the post.
7. If you have other questions please let us know.
8. LOOSEN up bit - you got a lot of good free advice that would be difficult to come by without the efforts of other members on the board.
9. NTDOC should also loosen up a bit - sorry but your tone sounded a bit harsh and struck a cord with me I suppose. Sorry
10. HAPPY HOLIDAYS
.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 369 anonymous users online.
|
|
|