Ubuntu Servers :: Backup-script - Ssh - Output Result To Text File?

Nov 5, 2010

Im using this script to save a backup to a NAS, however i want to print the result to a file that later can be mailed to me.

Code:

tar --totals -czf - /var/www | ssh user@host "cat > /backup_path/`date "+%Y-%m-%d"`.tar.gz"

i have tried just adding ">> logfile.txt" at the end of the command, but that obviously does not work. How should i do this?

View 2 Replies


ADVERTISEMENT

Ubuntu :: Sort The Output To A Text File So That It Prints To The Text File At 1 Process Per Line?

Feb 6, 2011

im trying to output a list of running processes via a shell script. At the moment i got this which outputs the processes to a text file called out.

echo $(ps aux) >>out

The problem is though, the processes are all just one big block of text which makes it hard to read. Does anyone know how to sort the output to a text file so that it prints to the text file at 1 process per line? I know its probably simple but im very new to linux.

View 5 Replies View Related

General :: Script To Access Sqlplus And Use The Output To Replace The Result In Another File?

Aug 30, 2010

I am trying to write a script to access sqlplus and use the output to replace the result in another file. But I am having some issues with it (This script is just a test script and I am just trying to print the updated value.

#!/bin/bash
I am not able to post the sqlplus connection, but it works.
bb=$a

[code]....

View 2 Replies View Related

General :: Write A Script To Access Sqlplus And Use The Output To Replace The Result In Another File?

Aug 30, 2010

I am trying to write a script to access sqlplus and use the output to replace the result in another file. But I am having some issues with it (This script is just a test script and I am just trying to print the updated value.

#!/bin/bash
a=`echo exit|sqlplus -S -L xxx/xxx@xxx @test.sql`
bb=$a

[code].....

View 5 Replies View Related

Ubuntu :: Output Data From Text File Into A Table?

Apr 13, 2010

I'm having a slight dilemma on reading data from a text file and outputting it into a table then displaying it. Basically I'm writing a shell script that takes information from text files then outputs the data into a table with 4 headings. The extracting of the data is fine, but creating a table i'm having problems with. My code extracts the data outputs the string to another file which works fineThe text file looks like this

mr smith 1 purchase oct 2007
mrs smith 2 purchase nov 2006
i want it to look like this

[code]....

View 7 Replies View Related

General :: Output A Text File In Proper Format?

Mar 4, 2010

it compares two files using md5... if they are same , a corresponding character is output to a text file .. but the problem is it gets appended by default.. is there any way to output in a normal way because the text is a message and it should be of proper format
here is my script

Code:

#!/bin/bash
g=`tail -1 new.txt|head -n 1`
array=( a b c d e f g h i j k l m n o p q r s t u v w x y z )
for((i=1 ; i <$g+1 ; i++))

[code]....

the message is supposed to be hello , i need to get rid of the endlines somehow..

View 2 Replies View Related

General :: Output To A Text File, The Results Of Compound Command?

Jul 28, 2010

How to output to a text file the compound command:

Code:
find -type f -print0 | xargs -0 grep -l "desired text"
I have not been able to find the answer.

[code]...

View 5 Replies View Related

General :: Read Data From Text File And Output Into A Table?

Apr 12, 2010

I'm having a slight dilemma on reading data from a text file and outputting it into a table then displaying it. Basically I'm writing a shell script that takes information from text files then outputs the data into a table with 4 headings.he extracting of the data is fine, but creating a table i'm having problems with. I think it is possible to do it using the awk function, but so far i'm having a lot of difficulties.

View 14 Replies View Related

General :: Iperf Won't Export All Command Output To Text File?

Oct 18, 2010

I've created a script to test network speeds but I've run in to a little problem. The command outputs this:

Code:
Client connecting to 192.168.111.230, UDP port 5001
Sending 1470 byte datagrams

[code]...

View 1 Replies View Related

General :: Script To Output Both The Stderr And Stdout To The Same Text File?

Aug 5, 2011

Am having issues getting the output from a script to be logged in a file. I need the script to output both the stderr and stdout to the same text file.

At present I have the following script:

Code:
#!/bin/bash
echo TR3_1 > printers.txt
snmpget -v 1 -c public 10.168.**.* SNMPv2-SMI::mib-2.43.10.2.1.4.1.1 &>> printers.txt

[Code].....

View 4 Replies View Related

General :: Write Expdp Output In A Text File Using A Shell Script ?

Feb 7, 2011

I want to write expdp output in a text file using a shell script

If i write like below:

It will write whatever is there in log file to text file

But, sometimes export fails with out start taking export (without generating log file) because of job already exists error. such times, we dont know about that error until we check manually... so i wrote like below:

But still it is not writing anything in to text file using above stmt...

View 1 Replies View Related

Ubuntu Multimedia :: 2 Capture Cards Result In Bad /dev/video0 And /dev/video1 Output

Oct 3, 2010

I have 3 old video capture cards which I would like to use for CCTV. Each card supports 1 camera. So I would like to have 3 cameras setup in the end and monitor them with zoneminder. When each card is plugged in on it's own, it works fine. Video comes through clearly with xawtv and zoneminder. However as soon as I plug in a 2nd card (with or without a camera connected) the output in xawtv and zoneminder goes haywire. It looks like the 2nd card takes over the first card, resulting in majority of the picture coming from the 2nd card, and some (if any) from the 1st card. When viewing either of the two cards /dev/video0 or /dev/video1 in xawtv the output is identical. I've tried this on a fresh 10.04 Ubuntu install, and on an older MythTV debian computer, the same results. Here are lspci -vv outputs with 2 combinations of cards (same fuzzy output):

[URL]

My thoughts are because the capture cards are cheap (similar to winmodems), the problem may be in the software kernel modules not allowing room for other similar capture cards to run at the same time. Can anyone suggest me in the right direction? Do I need to setup some sort of memory allocation for each card manually? Something in the BIOS? An extra option when the card modules are loaded?

View 1 Replies View Related

Ubuntu Servers :: Backup MySQL To A Date Named File?

Sep 23, 2010

I am manually backing up my server now with mysqldump and that works but I was wondering about mechanizing the process.

Nirvana would be to dump to a file named with the date

This way I have backups going back over time

View 9 Replies View Related

Programming :: Sed To Output Block Of Text If Specified Text Is Matched?

Feb 13, 2010

I am trying to find sed command combination to print out the "start command" line, the id line and all lines between "details" and "stop command" only if "error" exists. Here's the original output (test.txt):

start command
id 1
kajsdlfjsalj

[code]...

View 3 Replies View Related

Ubuntu Servers :: Text File Containing Permissions?

Jun 9, 2010

Is it possible to have a text file somewhere that contains a list of all users that are allowed access to a given folder? This would be fantastic for file servers on a network.

View 1 Replies View Related

Ubuntu Servers :: MySQL Incremental Backup - Binary Log File Names

Mar 15, 2011

I am currently using a script to backup my Ubuntu 10.04.1 system. The mySQL databases are backed up separately from the the system / data.

My problem is with the mySQL incremental / binary log backups.

The problem is that the binary log file(s) are always named xxxx-bin.1.

Up to about a month ago the binary logs were named xxxx-bin.000001, xxxx-bin.000002, etc.

I did make some changes at about the time that this change in file naming ocurred, but I can not identify what, if any, setting I may have changed that has caused all of the binary log files to always have the same name.

My back up script uses both mysqldump and mysqladmin flush-logs to create the binary logs.

All of the setting for mysqldump and mysqladmin are contained in the my.cnf file.

The my.cnf file contents that are relavent are as follows:

Code:

The statements in the backup script that do the backup are:

mysqladmin flush-logs

or

mysqldump | gzip > $DB_BACKUP_DIR/$ARCHIVE_FILE #Note: delete-master-logs in my.cnf

View 3 Replies View Related

Ubuntu Servers :: Using TShark And Grep - Output Empty File?

Jul 13, 2011

I am not sure why this does not work..
tshark |grep 'string'
Gives me what I want but
tshark |grep 'string' >/tmp/outputfile
Gives me an empty file.

View 3 Replies View Related

Fedora Servers :: Create A Backup To A Remote File System?

Jun 26, 2010

Attempting to create a backup script to copy files from one file system to a remote file system.

When I try this I get:

Quote:

# tar -cf - /mnt/raid_md1 | gzip -c | ssh -i ~/.ssh/key -l user@192.168.1.1 "cat > /mnt/backup/fileserver.md1.tar.gz"
tar: Removing leading `/' from member names
Pseudo-terminal will not be allocated because stdin is not a terminal.
ssh: Could not resolve hostname cat > /mnt/backup/fileserver.md1.tar.gz: Name or service not known

[Code].....

I know that the remote file system dir is RW and the access is working fine. I am stumped...

View 3 Replies View Related

General :: Get Output Of Text File Containing Account Number, Debit Amount, Credit Amount,date Using Shell Script?

Apr 9, 2011

How to get output of text file containing account number, debit amount, credit amount,date using shell script?

View 1 Replies View Related

Ubuntu Servers :: Useful Server Information - Php File - Runs A Few Commands And Echoes The Output

Jan 25, 2010

Php file that basically runs a few commands and echoes the output. It's for checking things like temperatures etc, space free.

You can see it in action here: [url]

I've attached the actual php file.

Two questions:

1) What more can I add to it to give me even more information?

2) I want to add hddtemp but it requires sudo to run. How can I get around this?

View 4 Replies View Related

Ubuntu Servers :: Result From Mailgraph And Pflogsumm Different?

Jun 7, 2011

I have installed postfix with amavisd, spamassassin, and clamav on ubuntu 10.04 server, all works as well. But, when I test to send 2 messages from outside to my server, the report from mailgraph and pflogsumm is different. To avoid pflogsumm count twice from amavis, I have combine pflogsumm with preflog. And the result like this .

Quote:
root@mail:/home/venol# /usr/sbin/prepflog.pl -d today /var/log/mail.log | pflogsumm | more
Grand Totals
messages
2 received
2 delivered
Host/Domain Summary: Message Delivery

[Code]...

View 2 Replies View Related

Ubuntu Servers :: Mysql-admin Won't Schedule Backup But Will Manual Backup

Jan 19, 2010

I have a scheduled backup to run on our server at work and since the 7/12/09 it has be making 592k files instead of 10Mb files, In mysql-admin (the GUI tool) I have a stored connection for the user 'backup', the user has select and lock rights on the databases being backed up. I have a backup profile called 'backup_regular' and in the third tab along its scheduled to backup at 2 in the morning every week day. If I look at one of the small backup files generated I see the following:

Code:

-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version`

[code]....

It seems that MySQL can open and write to the file fine, it just can't dump

View 3 Replies View Related

Software :: Backup A Few Servers And A Bunch Of Desktops Onto One Backup Server?

May 10, 2010

Does anyone know of any decent enterprise level backup solutions for Linux? I need to backup a few servers and a bunch of desktops onto one backup server. Using rsync/tar.gz won't cut it. I need like bi-monthly full HDD backups, and things such as that, with a nice GUI interface to add/remove systems from the backup list. I need basically something similar to CommVault or Veritas. Veritas I've used before but it has its issues, such as leaving 30GB cache files. CommVault, I have no idea how much it is, and if it supports backing up to a hard drive rather than tape.

View 7 Replies View Related

Programming :: Remove Lines In A Text File Based On Another Text File?

Jan 28, 2009

I have a text file called file1.txt containing many lines eg.

line1
line2
line3
line4
line5
line6

Then i have another text file called file2.txt contains

3
5
6

Is there a command to remove the lines in file1.txt based on the keywords in file2.txt? note: It should remove line3,line5,line6 based on 3,5,6

View 10 Replies View Related

Ubuntu :: Can't Mount Or Read Ddrescue Result File

Feb 23, 2010

Can't mount or read ddrescue result file

View 1 Replies View Related

Debian :: Backup Purge Script - `/mnt/backup/subfolder': No Such File Or Directory

Nov 10, 2010

This script simply deletes files older than a certain age (in this case 7 days) from a certain location; I use it to purge old backups nightly, and it works as expected:

# delete backups older than 7 days
find /mnt/backup/*  -mtime +7 -exec rm -Rf {} ;

The problem is, every morning I get an email with an error message something like this:

find: `/mnt/backup/subfolder': No such file or directory

View 2 Replies View Related

General :: File Is An Automated Backup Script, Backup.sh?

Sep 13, 2010

Can some one give me a sample of a crontab for backing a directory please, System is Ubuntu 9.04Quote:

#!/bin/bash
# this file is an automated backup script, backup.sh.
# this backs up my domain site.

[code]....

View 7 Replies View Related

General :: Assigning Query Result Into A Variable/file?

May 25, 2011

I am connecting to MySQL DataBase using shellscript and writing a select statement like select attachmentid from attachments where pageid=10175 I want to store the output of the select statement into a shellvariable or a file. How can i do it using shellscript.

View 4 Replies View Related

Ubuntu :: Appending Text To The Output Of Ls?

Jul 14, 2011

I was wondering if it is possible to append some text to the output of ls. Like say, if i wanted to create symbolic links for all the files under a folder in my hard disk to a folder on my desktop, I could say (Pretty sure this won't work, but I am looking forward to something like this) echo ln -s | ls . This should append ln -s to all the files of ls.

View 2 Replies View Related

Ubuntu :: Slow Down Text Output In Terminal?

Feb 15, 2011

I'd like to write a script that invokes a gnome-terminal session which slowly reads out text like the phosphor screensaver (could be anything, a log file, ascii art, song lyrics, whatev) and then closes. I can invoke a terminal using [gnome-terminal -e 'cat /var/log/dmesg'] but the output flies pass by too quickly.any way to slow it down? I know it seems like an odd request but if anyone has a suggestion I'd love to hear it.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved