I'm writing a bash shell script to backup several mysql databases. This script will run on a daily basis and send a copy to a remote FTP repository. The filenames are in the format DATE.backup.sql. How do I store the DATE variable so I can delete/move/etc the file on the FTP server the next time the script runs?
I can use pretty much any method, but it has to be done within this bash script.
Hi unix gurus,
I am trying to store the result of a command into a variable.
But it is not getting stored.
x='hello'
y=echo $x | wc -c
but it is giving the output as 0(zero)
Pls help me its very urgent (7 Replies)
how would i go about storing this command in a variable
echo "$LINE" | awk -F"|" '{print $1"|"$2"|"$3"}'
i have tried FOO = ${command up there} but receive the error FOO: not found
aswell as a couple of other attempt but no luck (2 Replies)
Hi Everyone,
I have a code which requires to be stored in different variables and I am achiving it like this.
HOST=`echo $RMP | cut -f2 -d:`
NAME=`echo $RMP | cut -f3 -d:`
DIR=`echo $RMP | cut -f4 -d:`
TYPE=`echo $RMP | cut -f5 -d:`
Is there any other way of storing value... (2 Replies)
Hi all,
I m new to this forum.
I ma facing onei issue.
I have something like this:
length= wc -l < b2| awk '{print $1}'
where b2 is filename having detauls like:
cat b2
abc1
abc4
xyc3
sbdghf4
but when I do echo "$length" it displays nothing
Also I am using awk to overcome... (4 Replies)
Hi,
I have a ftp script there I want to store the o/p of the below command:
sftp -b <batch file> user@password
cat <batch file>
get /remote/file/path/remote_file_name.csv*.gz /local/path
Now the problem is that when I fire this command. Then it gives o/p as:
File... (7 Replies)
Hi,
ps -ef|awk '{print $2}'
i want to store the result of the above command in a variable.
I never worked with arrays in shell scripting.
i tried the below code:
set a=`ps -ef|awk '{print $2}'`
But echo $a returns null.
I want to store the content in a variable and retrieve it... (2 Replies)
My script below seems to be choking because I need the the output of the find command to be stored as a variable that can then be called by used lower in the script.
#!/bin/bash
cd "/resumes_to_be_completed"
var1=find . -mmin -1 -type f \( -name "*.doc" -o -name "*.docx" \)... (1 Reply)
I would like to use sed to store a variable.
The code is :
echo $HEADERREC
CUTVAR=$(echo "$HEADERREC"|sed 's/SDV/STR')
echo $CUTVAR
Output I am getting now:
0012PVGRSCDVSDV 005 00000000000000000000 2014 0.00
sed: Function s/SDV/STR cannot be parsed.
Desired... (5 Replies)
I have a below syntax its working fine...
var12=$(ps -ef | grep apache | awk '{print $2,$4}')
Im getting expected output as below:
printf "%b\n" "${VAR12}"
dell 123
dell 456
dell 457
Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
LEARN ABOUT DEBIAN
svn-backup-dumps
svn-backup-dumps(1) General Commands Manual svn-backup-dumps(1)NAME
svn-backup-dumps - Create dumpfiles to backup a subversion repository.
SYNOPSIS
svn-backup-dumps <repos> <dumpdir>
DESCRIPTION
svn-backup-dumps creates dumpfiles from a subversion repository. It is intended for use in cron jobs and post-commit hooks.
The basic modes of operation are:
o Create a full dump (revisions 0 to HEAD)
o Create incremental dump containing at most N revisions.
o Create incremental single-revision dumps (for use in post-commit).
Dumpfiles are named in the format basename.rev.svndmp or basename.rev.rev.svndmp, where basename is the repository directory name, and the
rev arguments are the first and last revision numbers represented in the dumpfile, zero-padded to 6 digits.
Optionally, svn-backup-dumps can compress dumpfiles with gzip or bzip2, and can transfer them to another host using FTP or SMB (using smb-
client).
OPTIONS --version
Show program's version number and exit.
-h, --help
Show this help message and exit.
-b Compress the dump using bzip2.
--deltas
This is passed through to svnadmin dump.
-c count
Maximum number of revisions per dumpfile.
-o Overwrite files.
-O Overwrite all files.
-q Quiet.
-r rev Specify a single-revision dumpfile.
-t ftp:host:user:password:path
-t smb:share:user:password:path
Transfer dumps to another machine using the FTP or SMB protocols. path is where to store the dumpfiles on the remote server; any
occurrence of %r in the path is replaced by the repository name. Support for "smb:" requires the smbclient program.
-z Compress the dump using gzip.
EXAMPLES
To create a full dump of all revisions of a repository /srv/svn/foo in the directory /var/backup/svn:
svn-backup-dumps /srv/svn/foo /var/backup/svn
The dumpfile will be named src.000000-NNNNNN.svndmp.gz where NNNNNN is the head revision number.
To create incremental dumps containing at most 1000 revisions:
svn-backup-dumps --deltas -z -c 1000 /srv/svn/foo /var/backup/svn
If the youngest revision is 2923, it creates the following files:
foo.000000-000999.svndmp.gz
foo.001000-001999.svndmp.gz
foo.002000-002923.svndmp.gz
If run again, later, when the youngest revision is 3045, it creates these two files:
foo.002000-002999.svndmp.gz
foo.003000-003045.svndmp.gz
Note that it does not remove the redundant file foo.002000-002923.svndmp.gz.
To create incremental single-revision dumps from a post-commit hook:
svn-backup-dumps -r $rev $repos /var/backups/svn
where $rev and $repos are variables previously set in the post-commit script from its command line. The dumpfile name will be in the form
foo.000352.svndmp.
To send the dumpfiles to the SMB share \ERNESTBACKUPS in a directory svnfoo with user svnuser and password w0rth1ng:
svn-backup-dumps -t "smb://ERNEST/BACKUPS:svnuser:w0rth1ng:svn/%r /srv/svn/foo /tmp/tmpbackup
Note that the %r in the path is replaced by the repository name foo. Note also that a local backup directory is required, at present, even
when using the -t option.
AUTHOR
Voluntary contributions made by many individuals. Copyright (C) 2006 CollabNet.
2006-11-09 svn-backup-dumps(1)