SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
Windows Messaging
Author Message
Post Windows Messaging 
Where could I add a line to send a netbios/smb message to a workstation when a
backup is about to start? The line would be something like:

"Your machine is now being backed up..blah blah" | smbclient -M $host -
U "BackupPC" >> /dev/null

Any ideas? I thought it may be help on a machine by machine bases to allow
this as an option. Just another way let users know when a backup starts (and
stops).

Thanks,

Paul
-----------------------------------------------------------
www.netxposed.com

Maintaining the integrity of network data by Xposing the
vulnerabilities and increasing network security awareness.


-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Post Windows Messaging 
Paul Weekley writes:

Where could I add a line to send a netbios/smb message to a
workstation when a backup is about to start? The line would be
something like:

"Your machine is now being backed up..blah blah" | smbclient -M $host
-U "BackupPC" >> /dev/null

Any ideas? I thought it may be help on a machine by machine bases to allow
this as an option. Just another way let users know when a backup starts (and
stops).

See $Conf{DumpPreUserCmd}. Note that BackupPC doesn't execute commands
with /bin/sh (it calls exec() directly since the security is better).
Therefore, pipes and redirects won't work inside $Conf{DumpPreUserCmd}
(unless you add /bin/sh -c to the front of your command, and do
some tricky quoting).

Instead, put your commands in a short shell script, and point
$Conf{DumpPreUserCmd} to your script.

Craig


-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Post Windows Messaging 
Thanks for the quick feed back. I create a sh script with:
echo "This is a TEST"|smbclient -U "BackupPC" -M TYRANT >>/dev/null

and in my main config.pl:
$Conf{DumpPreUserCmd} = '/usr/local/backuppc/smbnetsend';

This still does not seem to send the message, although it works from the
shell.. I am a little puzzled. Should this not send a message to the same
machine every time a backup starts?

Thanks,

Paul


Quoting Craig Barratt <cbarratt < at > users.sourceforge.net>:

Paul Weekley writes:

Where could I add a line to send a netbios/smb message to a
workstation when a backup is about to start? The line would be
something like:

"Your machine is now being backed up..blah blah" | smbclient -M $host
-U "BackupPC" >> /dev/null

Any ideas? I thought it may be help on a machine by machine bases to allow

this as an option. Just another way let users know when a backup starts
(and
stops).

See $Conf{DumpPreUserCmd}. Note that BackupPC doesn't execute commands
with /bin/sh (it calls exec() directly since the security is better).
Therefore, pipes and redirects won't work inside $Conf{DumpPreUserCmd}
(unless you add /bin/sh -c to the front of your command, and do
some tricky quoting).

Instead, put your commands in a short shell script, and point
$Conf{DumpPreUserCmd} to your script.

Craig




-----------------------------------------------------------
www.netxposed.com

Maintaining the integrity of network data by Xposing the
vulnerabilities and increasing network security awareness.

Post Windows Messaging 
I forgot to show the log:
Executing DumpPreUserCmd: /usr/local/backuppc/smbnetsend
Exec of /usr/local/backuppc/smbnetsend failed

The smbnetsend has the user rights of BackupPC.. Does this info help?

====
Thanks for the quick feed back. I create a sh script with:
echo "This is a TEST"|smbclient -U "BackupPC" -M TYRANT >>/dev/null

and in my main config.pl:
$Conf{DumpPreUserCmd} = '/usr/local/backuppc/smbnetsend';

This still does not seem to send the message, although it works from the
shell.. I am a little puzzled. Should this not send a message to the same
machine every time a backup starts?

Thanks,

Paul


Quoting Craig Barratt <cbarratt < at > users.sourceforge.net>:

Paul Weekley writes:

Where could I add a line to send a netbios/smb message to a
workstation when a backup is about to start? The line would be
something like:

"Your machine is now being backed up..blah blah" | smbclient -M $host
-U "BackupPC" >> /dev/null

Any ideas? I thought it may be help on a machine by machine bases to allow

this as an option. Just another way let users know when a backup starts
(and
stops).

See $Conf{DumpPreUserCmd}. Note that BackupPC doesn't execute commands
with /bin/sh (it calls exec() directly since the security is better).
Therefore, pipes and redirects won't work inside $Conf{DumpPreUserCmd}
(unless you add /bin/sh -c to the front of your command, and do
some tricky quoting).

Instead, put your commands in a short shell script, and point
$Conf{DumpPreUserCmd} to your script.

Craig




-----------------------------------------------------------
www.netxposed.com

Maintaining the integrity of network data by Xposing the
vulnerabilities and increasing network security awareness.

Post Windows Messaging 
Paul Weekley writes:

Thanks for the quick feed back. I create a sh script with:
echo "This is a TEST"|smbclient -U "BackupPC" -M TYRANT >>/dev/null

and in my main config.pl:
$Conf{DumpPreUserCmd} = '/usr/local/backuppc/smbnetsend';

This still does not seem to send the message, although it works from the
shell.. I am a little puzzled. Should this not send a message to the same
machine every time a backup starts?

Yes, it should. Perhaps the backuppc user doesn't have a path
setting that includes smbclient? You should remove the ">> /dev/null"
and see what errors/output are in the XferLog file - any output from
the Pre/Post commands goes there. Also, does your script start with
an explicit path such as:

#!/bin/csh -f

Finally, you might want to change it so the host name gets passed to
the script:

$Conf{DumpPreUserCmd} = '/usr/local/backuppc/smbnetsend $host';

and then use $1 (first argument) in your script to get the hostname.

Craig


-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Post Windows Messaging 
That did the trick! Smile BackupPC is an amazing tool! I add the $host also..
works like a dream..

Thanks for the help.

Paul


Quoting Craig Barratt <cbarratt < at > users.sourceforge.net>:

Paul Weekley writes:

Thanks for the quick feed back. I create a sh script with:
echo "This is a TEST"|smbclient -U "BackupPC" -M TYRANT >>/dev/null

and in my main config.pl:
$Conf{DumpPreUserCmd} = '/usr/local/backuppc/smbnetsend';

This still does not seem to send the message, although it works from the
shell.. I am a little puzzled. Should this not send a message to the same

machine every time a backup starts?

Yes, it should. Perhaps the backuppc user doesn't have a path
setting that includes smbclient? You should remove the ">> /dev/null"
and see what errors/output are in the XferLog file - any output from
the Pre/Post commands goes there. Also, does your script start with
an explicit path such as:

#!/bin/csh -f

Finally, you might want to change it so the host name gets passed to
the script:

$Conf{DumpPreUserCmd} = '/usr/local/backuppc/smbnetsend $host';

and then use $1 (first argument) in your script to get the hostname.

Craig




-----------------------------------------------------------
www.netxposed.com

Maintaining the integrity of network data by Xposing the
vulnerabilities and increasing network security awareness.

Post Windows Messaging 
Craig Barratt <cbarratt <at> users.sourceforge.net> writes:


#!/bin/csh -f

Finally, you might want to change it so the host name gets passed to
the script:

$Conf{DumpPreUserCmd} = '/usr/local/backuppc/smbnetsend $host';

and then use $1 (first argument) in your script to get the hostname.



This is excellent! However, I am experiencing a small problem with the
following setup:

$Conf{DumpPreUserCmd} = '/usr/local/backuppc/smbnetsend $host $type';

smbnetsend:

#!/bin/bash
echo "A $2 backup of your pc has been started..."|/usr/bin/smbclient -M
BackupPC $1

For some reason, the popup message received is:

"The DumpPreUserCmd backup of your pc has been started..."

Did I miss something?

Mike





-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
_______________________________________________
BackupPC-users mailing list
BackupPC-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB