Search Results

Search: Posts Made By: perk_bud
3,222
Posted By perk_bud
Is there any way i can transfer the output of a...
Is there any way i can transfer the output of a command to a variable.?
3,222
Posted By perk_bud
So in my case the command is "dropdb" so will it...
So in my case the command is "dropdb" so will it be

"dropdb | tee"

But how do i store the outcome of the command in a var.

& i did not get the second option 2>&1 ( redirect stdout and...
3,222
Posted By perk_bud
A few questions from a newbie(shell script)
Q1>How do i read and write to file in shell script. Here is what i want let's assume the filename as "file1"

Read file1

Check the content of file1 which can be either "0" or "1"

if(content...
5,269
Posted By perk_bud
I'm using RedHat I thought rc6.d was used...
I'm using RedHat


I thought rc6.d was used for reboot what is rc2.d used for ?. Do i have 2 put it as "S11fle_name" does that mean that i since my filename is "backup.sh" right now it will...
5,269
Posted By perk_bud
Running a Cron Script only @ Startup Pls Help!!
Hi friends i have a script "backup.sh" which is stored in "/var/lib/pgsql" directory.

I want it to run as a cron so that it executes every time the system starts.

I tried the follwing method ...
14,737
Posted By perk_bud
Thanks i somehow managed to get it right any...
Thanks i somehow managed to get it right any ca'nt thank u enough.
32,502
Posted By perk_bud
Thanks for helping me actually i was making a...
Thanks for helping me actually i was making a very sily mistake as some garbage characters were getting into my script any way thanx a lot
32,502
Posted By perk_bud
I want to use the follwing command pwd in...
I want to use the follwing command

pwd in the script but it says command not found after executing
32,502
Posted By perk_bud
I want to display the result of the current...
I want to display the result of the current working directory in the script how do i do it
14,737
Posted By perk_bud
i tried to use cd /var/lib/pgsql but it gives...
i tried to use cd /var/lib/pgsql but it gives error even "pwd" does not show anything

to execute dropdb bank i must be in the var/lib/pgsql directory
32,502
Posted By perk_bud
pwd & cd commands not working in shell script
Here is my script

#!/bin/bash
pwd
cd /var/lib/pgsql

Both "pwd" and "cd" are not executed is there any other way i can change the current working directory to /var/lib/pgsql pls help!
14,737
Posted By perk_bud
I'm really sorry PGUSER=postgres ...
I'm really sorry

PGUSER=postgres
PGPASSWORD=""
export PGUSER PGPASSWORD

is not required now the "pg_dump bank > backup" command works but the "dropdb bank" command does not work it says...
14,737
Posted By perk_bud
I dont know i'm getting an error in my script...
I dont know i'm getting an error in my script which is almost the same! As u can see in the above example they are entering the username and password that i think that is necessary.
14,737
Posted By perk_bud
This is an example script which works perfectly...
This is an example script which works perfectly and executes the command "pg_dump" even though the mentioned password is wrong
...
14,737
Posted By perk_bud
no i'll tell u normally this is how i do it i...
no i'll tell u normally this is how i do it i iniate a telnet session using windows run command

it asks me for a login : postgres

after which it does not ask for password as no password is...
14,737
Posted By perk_bud
This is the script i wrote and saved it as "u.sh"...
This is the script i wrote and saved it as "u.sh"
--------------------------------------------------
#!/bin/bash
PGUSER=postgres
PGPASSWORD=""
export PGUSER PGPASSWORD

pg_dump bank > backup...
14,737
Posted By perk_bud
thanx is it possible for u 2 tell me how to check...
thanx is it possible for u 2 tell me how to check wether the file exists i do not want to overwrite it every time i would delete it every time if only u could tell me how
14,737
Posted By perk_bud
sorry once again before i execute "pg_dump...
sorry once again

before i execute "pg_dump bank > backup" i want to check if the backup file already exists if it does delete it else continue as u normally would.
14,737
Posted By perk_bud
1 more thing i wanted to know about cron do i...
1 more thing i wanted to know about cron do i have to put my file in the cron.hourly or cron.daily folder or just crontab -e and do what u said and how do send myself an email from cron - the tasks...
14,737
Posted By perk_bud
"input_path" means where u want to take the...
"input_path" means where u want to take the backup right ?

Aneways thanx a bunch budy:) i'll try it out and let u know. 1 more thing i wanted to know about cron do i have to put my file in the...
14,737
Posted By perk_bud
a
"pg_dump bank > backup" takes the backup of the database which may take some time only after the process is complete can i run the run the next command that is "dropdb bank" which deletes the...
14,737
Posted By perk_bud
First of all thanks How do i do...
First of all thanks





How do i do it
14,737
Posted By perk_bud
shell script to run a few commands help!
Hi friends this is first post i am very new to shell scripting so i require your expertise to do the following thank u

I need to write a shell script which will run the following commands
...
Showing results 1 to 23 of 23

 
All times are GMT -4. The time now is 03:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy