User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 426,940 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,330 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 3177 | Replies: 23
Reply
Join Date: Jan 2007
Location: Ireland
Posts: 1,630
Reputation: DimaYasny will become famous soon enough DimaYasny will become famous soon enough 
Rep Power: 6
Solved Threads: 70
Featured Poster
DimaYasny DimaYasny is offline Offline
Posting Virtuoso

Re: cronjob problem in the script

  #21  
Jan 31st, 2008
script1.sh:
ècho Enter minute:
read minute
echo Enter hour:
read hour
/some/dir/script2.sh $minute $hour

script2.sh:
echo "$1 $2 * * * /some/dir/BackupScript.sh >/tmp/backupcron.log" >>/etc/crontab
Real stupidity always beats Artificial Intelligence. (Terry Pratchett)

BA BizMg, MCSE, DCSE, Linux+, Network+
Reply With Quote  
Join Date: Aug 2007
Posts: 39
Reputation: namishtiwari is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
namishtiwari namishtiwari is offline Offline
Light Poster

Re: cronjob problem in the script

  #22  
Jan 31st, 2008
Hi Dima,

any solution for the default backup location problem which i mentioned just above your last thread.
Reply With Quote  
Join Date: Jan 2007
Location: Ireland
Posts: 1,630
Reputation: DimaYasny will become famous soon enough DimaYasny will become famous soon enough 
Rep Power: 6
Solved Threads: 70
Featured Poster
DimaYasny DimaYasny is offline Offline
Posting Virtuoso

Re: cronjob problem in the script

  #23  
Jan 31st, 2008
where is the default location, and how do you acquire an alternative?
Real stupidity always beats Artificial Intelligence. (Terry Pratchett)

BA BizMg, MCSE, DCSE, Linux+, Network+
Reply With Quote  
Join Date: Aug 2007
Posts: 39
Reputation: namishtiwari is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
namishtiwari namishtiwari is offline Offline
Light Poster

Re: cronjob problem in the script

  #24  
Jan 31st, 2008
Originally Posted by DimaYasny View Post
where is the default location, and how do you acquire an alternative?


Dima,

if you can look in the script which i wrote,at the beginning of this thread,i am implementing the functionality of copying inside the backuplocation itself actually we dont need this.
i need to write it like
if mention as now it should take the backup now otherwise when i schedule the cron part.

i tell you my actual requirement--

1)Utility will be run under Specific owner.
2) This utility will clean files in $INTAS_INSTALL_DIR/envsw/logs. And following logs will be backed up or deleted.

All Logs and Core files
3) mt_clean -a<action> [-t <time>]  -L <backup location>

-a<action> - has two values "delete" or "backup”. If not specified by default "delete" action will occur. If "backup" option is given, files will be backed up on the location specified by the -L, -L is mandatory if back up option is specified.

-t<time>  - The time is given with the -t option and its default is 1am

A time of 'now' means to execute the cleanup operation now
A time of 'never' means that the cleanup operation should not be scheduled and any existing cleanup should be cancelled.

-L <backup location> - this field is mandatory if backup action is selected.

Note: As middle tier process are running and not stopped while this utility is running, the utility should create an empty file with same name which has deleted or backed up. Otherwise middle tier logs will not be generated until the middle tier process is restarted. Any core files will be backed up or deleted according to the action chosen. 

i have created the script according to the req but its not doing anything for me so need your help,I will thansk alot if you can provide me a sample script for this.

Thanks
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Shell Scripting Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 12:28 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC