LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-23-2008, 08:16 AM   #1
saghir27
LQ Newbie
 
Registered: Apr 2008
Posts: 1

Rep: Reputation: 0
running a Simple script from Webmin


Hi

I am setting up filesystem backup in webmin. I am saving the backups to a file /backup/backup.tar

Every backup overwrites the backup.tar file.

The webmin backup module has a option to run a command after the backup is run.

I want to run this script from webmin after the backup

(I found this on this forum)
# script=dname
#parameter $1 is the existing file name
dt=`date +%y%m%d`
mv $1 $1$dt

I can run it from root manualy and it works. but it doesn't work from webmin.

Can someone tell me how I get this to work.

Or is their another command I can use?

I want the backup.tar file name to be changed to backup.tar+ today's date

I'm very new to linux so please answer in simple english.
 
Old 04-28-2008, 06:07 AM   #2
blacky_5251
Member
 
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 572

Rep: Reputation: 56
I suspect you want to replace $1 in your script example with /backup/backup.tar. So it would read:-
Code:
#!/bin/bash
# script=dname
dt=$(date +%y%m%d)
mv /backup/backup.tar /backup/backup.tar.$dt
In scripts, $1 means the first parameter passed to the script. Also, I prefer the $() syntax rather than using the back quoted syntax. It makes it less confusing when reading the script with odd fonts. So, dt=$(date +%y%m%d) will still put the correct value into $dt.

Anyway, see how that goes.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple script - check if program is running KrzysieQ Linux - Server 3 02-17-2008 08:48 AM
LXer: Simple, fast administration with Webmin LXer Syndicated Linux News 0 12-19-2007 05:10 PM
2 simple questions in the webmin . adam_blackice Linux - Server 2 06-25-2007 09:31 PM
Webmin simple backup fails Tenover Linux - Software 3 12-16-2005 12:32 PM
Webmin, simple module PLZ HELP! djkoe Linux - General 0 02-08-2004 09:51 AM


All times are GMT -5. The time now is 10:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration