The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
Google UNIX.COM


Windows & DOS: Issues & Discussions Questions involving Unix to Windows (Desktop or Server) go here. Any Windows/DOS questions should go here as well.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script required to get a required info from file. Pls. help me. ntgobinath Shell Programming and Scripting 2 05-31-2008 05:34 AM
Script Required Satadru Shell Programming and Scripting 1 05-08-2008 09:38 AM
Script required ntgobinath Shell Programming and Scripting 1 05-08-2008 08:35 AM
script required skyineyes Shell Programming and Scripting 13 06-26-2007 10:49 PM
Script help required! kev112 Shell Programming and Scripting 8 05-24-2005 01:33 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-13-2007
Registered User
 

Join Date: Feb 2007
Posts: 2
Post Required Script

As i am new to unix.i need a scrip for the below purpose

can unix script be used in windows ??

if so.. in my server with in a day, it generates log file to a size of minimun 3 GB in c drive by an application..which i need to manually cut and paste it F drive and then compress or zip.
for eg c:\hamsfa\site\001]log\.... -source to f:\hamsfa_log\001\ destination

required is.. the scripts first shuld zip the files which are older than 2 days inside c drive and then move it to f drive destination

even if this can been written in batch file.. that will be ok for me
Reply With Quote
Forum Sponsor
  #2  
Old 02-13-2007
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
We should probably move this thread to our Dos forum. What version of Windows? What program are you using to zip? Do you actually have unix running somewhere?
Reply With Quote
  #3  
Old 02-13-2007
Registered User
 

Join Date: Feb 2007
Posts: 2
script reply

Hi

i will be running this for an application called hamilotn. which has a log folder that gets filled up to GB with a day,the platform that i am using is winodws 2003 server, either winzip or windows compression (optional).after such script is made then this will handed to job scheduling team who will schedule the script to run in a period of day .. if this script can composed as batch file is also ok
Reply With Quote
  #4  
Old 02-14-2007
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
It is not easy to manipulate pathnames in a bat file, but I think I got it. I created a file called logjob.bat
Code:
@echo off
setlocal
set destdrive=f

set source=%1
set sourcedrive=%~d1
set var1=%~p1

set var2=%var1:\= %
call :procdir %var2%
echo source = %source%
echo dest = %dest%
goto :final

:procdir
set dest=%destdrive%:\%1_%4\%3\
exit /b

:final
endlocal
And when I run it in a command window:
Code:
C:\Data Files\utils>
C:\Data Files\utils>
C:\Data Files\utils>
C:\Data Files\utils>
C:\Data Files\utils>
C:\Data Files\utils>logjob c:\hamsfa\site\001\log\
source = c:\hamsfa\site\001\log\
dest = f:\hamsfa_log\001\

C:\Data Files\utils>
This is running under XP and I assume it will work on Server 2003. If so, it should get you started.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:13 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0