Script for Automatic Backup System

Hi Guys/ULF,

Good day! Can anyone help me on how to create a program which will be used for our backup process and that will run automatically say every 30th day of the Month. Below is the given command to perform a backup process among all nodes/servers within the same cluster.

ns cluster "ns management backup" all partition 1

This command will be executed only on the dedicated centralized server which has a capability the same backup process on other servers within same cluster. Upon running this command, this will perform the backup by asking the User whether to proceed with the backup or not. Here is a sample output below:

nssh# ns cluster "ns management backup" all partition 1
Command was launched from partition 1.


------------------------------------------------
Executing command in server server1

Remote user: <user>
Remote password: <password>
Remote directory: <backup directory>
Remote server: <IP Addr>

Start backup? (no/yes) yes

Create backup file...
Transfer backup file...
  Interactive mode off.


------------------------------------------------
Executing command in server server2

Remote user: <user>
Remote password: <password>
Remote directory: <backup directory>
Remote server: <IP Addr>

Start backup? (no/yes) yes

Create backup file...
Transfer backup file...
  Interactive mode off.

Note: Text in RED color are user input.

Appreciate any input from you guys :slight_smile:
Thanks and God bless!

Best Regards,
rymnd_12345

---------- Post updated at 08:04 AM ---------- Previous update was at 07:03 AM ----------

Guys,

The main problem in creating this program is that, How can I do it without having the user type the word "yes" as if the script behaves like automatic and gives response "yes" once the prompt has seen, (eg. using expect, but I don't have an idea on how to integrate it on shell or perl script.) Please help :slight_smile:

Br,
rymnd_12345

Hi Guys,

Any update so far? Appreciate any suggestions from you. I just would like to have this for me to automate our backup procedure. How to import the word "yes" whenever the command for backup process already runs and prompting the user for confirmation. Please advise. :slight_smile:

Br,
rymnd_12345

You may get away with this (depends how and when the application reads from the terminal):

yes yes | command

See "man yes".