running backup

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

running backup

Jon Miller-5
I have a file that I want to run daily to backup data.  This tgz file then needs to be copied to a Windows 2003 server.  I'm using smbclient, but it does not seem to work thru the script.  Can someone point out where the problem lies.  I run this as a cron job as follows:
30 19 * * 1,2,3,4,5 root /root/rubybackup.sh

The script is as follows:
#!/bin/sh
# script to automate the backup of the Ruby server to the W2K3 server
#
DAY=`date +'%a-%d-%m-%y'`
BACKUPDIR=/backup
RUBYLIVE=/var/lib/mysql/

cd $RUBYLIVE
tar -czvf /backup/rubylive${DAY}.tgz ./rubylive

cd $BACKUPDIR
smbclient //server/backup tfc651800 -U administrator
put rubylive${DAY}.tgz


Thanks

Reply | Threaded
Open this post in threaded view
|

Re: running backup

Florian Kulzer
On Wed, May 31, 2006 at 13:56:39 +0800, Jon  Miller wrote:

> I have a file that I want to run daily to backup data.  This tgz file then needs to be copied to a Windows 2003 server.  I'm using smbclient, but it does not seem to work thru the script.  Can someone point out where the problem lies.  I run this as a cron job as follows:
> 30 19 * * 1,2,3,4,5 root /root/rubybackup.sh
>
> The script is as follows:
> #!/bin/sh
> # script to automate the backup of the Ruby server to the W2K3 server
> #
> DAY=`date +'%a-%d-%m-%y'`
> BACKUPDIR=/backup
> RUBYLIVE=/var/lib/mysql/
>
> cd $RUBYLIVE
> tar -czvf /backup/rubylive${DAY}.tgz ./rubylive
>
> cd $BACKUPDIR
> smbclient //server/backup tfc651800 -U administrator
> put rubylive${DAY}.tgz

The recommended procedure for smbclient in scripts is to use the -c
option for the command string. In your case that would probably be
something like

smbclient //server/backup tfc651800 -U administrator -c "put rubylive${DAY}.tgz; exit"

Is it really necessary to use the administrator account for pushing a
backup file to the server?

--
Regards,
          Florian


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: running backup

Ron Johnson
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Florian Kulzer wrote:

> On Wed, May 31, 2006 at 13:56:39 +0800, Jon  Miller wrote:
>> I have a file that I want to run daily to backup data.  
>>This tgz file then needs to be copied to a Windows 2003 server.
>>I'm using smbclient, but it does not seem to work thru the script.
>>Can someone point out where the problem lies.  I run this as a
>>cron job as follows:
>> 30 19 * * 1,2,3,4,5 root /root/rubybackup.sh
>>
>> The script is as follows:
>> #!/bin/sh
>> # script to automate the backup of the Ruby server to the W2K3 server
>> #
>> DAY=`date +'%a-%d-%m-%y'`
>> BACKUPDIR=/backup
>> RUBYLIVE=/var/lib/mysql/
>>
>> cd $RUBYLIVE
>> tar -czvf /backup/rubylive${DAY}.tgz ./rubylive
>>
>> cd $BACKUPDIR
>> smbclient //server/backup tfc651800 -U administrator
>> put rubylive${DAY}.tgz
>
> The recommended procedure for smbclient in scripts is to use the -c
> option for the command string. In your case that would probably be
> something like
>
> smbclient //server/backup tfc651800 -U administrator -c "put rubylive${DAY}.tgz; exit"
>
> Is it really necessary to use the administrator account for pushing a
> backup file to the server?

Windows has functional non-Administrator accounts??????  :\

- --
Ron Johnson, Jr.
Jefferson LA  USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEfVUqS9HxQb37XmcRAuiTAJ4mM5kh1BhjohIyRlVbO6iDNGErVQCeKpl4
4mE7ehcYYEZWwkQsSXuzN/s=
=plQI
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: running backup

Florian Kulzer
On Wed, May 31, 2006 at 03:34:51 -0500, Ron Johnson wrote:

> Florian Kulzer wrote:
> > On Wed, May 31, 2006 at 13:56:39 +0800, Jon  Miller wrote:
> >> I have a file that I want to run daily to backup data.  
> >>This tgz file then needs to be copied to a Windows 2003 server.
> >>I'm using smbclient, but it does not seem to work thru the script.
> >>Can someone point out where the problem lies.  I run this as a
> >>cron job as follows:
> >> 30 19 * * 1,2,3,4,5 root /root/rubybackup.sh
> >>
> >> The script is as follows:
> >> #!/bin/sh
> >> # script to automate the backup of the Ruby server to the W2K3 server
> >> #
> >> DAY=`date +'%a-%d-%m-%y'`
> >> BACKUPDIR=/backup
> >> RUBYLIVE=/var/lib/mysql/
> >>
> >> cd $RUBYLIVE
> >> tar -czvf /backup/rubylive${DAY}.tgz ./rubylive
> >>
> >> cd $BACKUPDIR
> >> smbclient //server/backup tfc651800 -U administrator
> >> put rubylive${DAY}.tgz
> >
> > The recommended procedure for smbclient in scripts is to use the -c
> > option for the command string. In your case that would probably be
> > something like
> >
> > smbclient //server/backup tfc651800 -U administrator -c "put rubylive${DAY}.tgz; exit"
> >
> > Is it really necessary to use the administrator account for pushing a
> > backup file to the server?
>
> Windows has functional non-Administrator accounts??????  :\

Oops, my bad. Can we all pretend that it was a rhetorical question?

--
Regards,
          Florian


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: running backup

Jon Dowland-4
In reply to this post by Jon Miller-5
At 1149083799 past the epoch, Jon  Miller wrote:
> cd $BACKUPDIR
> smbclient //server/backup tfc651800 -U administrator
> put rubylive${DAY}.tgz

I think Florian has hit on the problem here, but it would be
easier in general if you supplied some kind of diagnostic
output rather than just "it does not work".

--
Jon Dowland
http://alcopop.org/


--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: running backup

Dave Ewart
In reply to this post by Jon Miller-5
On Wednesday, 31.05.2006 at 13:56 +0800, Jon  Miller wrote:

> #!/bin/sh
> # script to automate the backup of the Ruby server to the W2K3 server
> #
> DAY=`date +'%a-%d-%m-%y'`
> BACKUPDIR=/backup
> RUBYLIVE=/var/lib/mysql/
>
> cd $RUBYLIVE
> tar -czvf /backup/rubylive${DAY}.tgz ./rubylive

(Not related to what you asked, but might be important)

Are you backing up MySQL databases here via there location in the
filesystem?  If so, this is 'unsafe', since any changes made to the
databases during your 'tar' will not be handled properly: this *could*
result in a partially- or completely-useless backup.

You should really backup MySQL databases using mysqldump instead.

If that's not what you're doing, apologies...

Dave.
--
Please don't CC me on list messages!
...
Dave Ewart - [hidden email] - jabber: [hidden email]
All email from me is now digitally signed, key from http://www.sungate.co.uk/
Fingerprint: AEC5 9360 0A35 7F66 66E9 82E4 9E10 6769 CD28 DA92


signature.asc (198 bytes) Download Attachment