The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
.
google unix.com



Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

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 08:34 AM
Script Required Satadru Shell Programming and Scripting 1 05-08-2008 12:38 PM
Script required ntgobinath Shell Programming and Scripting 1 05-08-2008 11:35 AM
script required skyineyes Shell Programming and Scripting 13 06-27-2007 01:49 AM
Script help required! kev112 Shell Programming and Scripting 8 05-24-2005 04:33 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-13-2007
shameeque shameeque is offline
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
  #2 (permalink)  
Old 02-14-2007
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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?
  #3 (permalink)  
Old 02-14-2007
shameeque shameeque is offline
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
  #4 (permalink)  
Old 02-14-2007
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0