Sponsored Content
Top Forums Shell Programming and Scripting SFTP file and archive only if its succedded Post 302906379 by Pratik4891 on Thursday 19th of June 2014 07:30:04 AM
Old 06-19-2014
Sorry its not working

I have ran the code in an environment where the sFTP connection is not set up and it didnt ftped the file although the file is archived
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script to archive file

Hi All, I am trying to archive a file. I have the script to archive a file which is given below: #! /usr/bin/sh INITFILE="US_Recon" INITDIR="/var/opt/l2/CSN1/ap21" TMPDIR="/var/opt/sap2bn/out/CSN1/ap21/tmp" ARCHDIR="/var/opt/l2/CSN1/ap21" FINALDIR="/var/opt/sap2bn/out/CSN1/ap21"... (0 Replies)
Discussion started by: indira
0 Replies

2. UNIX for Dummies Questions & Answers

create a archive of old file

i need a script which will create a archive of the files older than 10 days........ (2 Replies)
Discussion started by: jayaramanit
2 Replies

3. Shell Programming and Scripting

File Archive Script

Hi There, I want to create a script that will archive files out of a log folder into seperate folders below it, but I need it to keep the previous 2 days worth of information. Now I know I can easily get a script to put the files in there but I don't know how to only get files older than 2 days,... (10 Replies)
Discussion started by: KeesH
10 Replies

4. Shell Programming and Scripting

Extracting from archive | compressing to new archive

Hi there, I have one huge archive (it's a system image). I need sometime to create smaller archives with only one or two file from my big archive. So I'm looking for a command that extracts files from an archive and pipe them to another one. I tried the following : tar -xzOf oldarchive.tgz... (5 Replies)
Discussion started by: chebarbudo
5 Replies

5. UNIX for Dummies Questions & Answers

Archive files that was already sftp'd/process

Hi, I need to modify my archive script to archive only files which is already sftp to the windows. We encounter some issue which the file is already archiving though it is not yet sftp'd to the Windows. Any answers.?Thanks! (1 Reply)
Discussion started by: sonja
1 Replies

6. Shell Programming and Scripting

Problem in test file operator on a ufsdump archive file mount nfs

Hi, I would like to ask if someone know how to test a files if exist the file is a nfs mount ufsdump archive file.. i used the test operator -f -a h almost all test operator but i failed file1=ufs_root_image.dump || echo "files doesn't exist && exit 1 the false file1 is working but... (0 Replies)
Discussion started by: jao_madn
0 Replies

7. Homework & Coursework Questions

Archive and purge the log file

Hi Unix Experts, I am new in this filed. I have assignment to Archive and purge the log file using shell scripts I tried I could not get the result please help me this. Ex: test.log requirement : using shell script I need to archive the log file and nil and the content of (test.log)... (1 Reply)
Discussion started by: johney1981
1 Replies

8. Shell Programming and Scripting

Archive old file

Hi All, I have the below senario. File_Name="^Test>*" Move_Delay=12 Source_Folder="/odi/nas/" Target_Folder="/odi/nas//archive" Now I want to move any file that is older than "Move_Delay" hours and matching "File_Name" pattern from the folder "Source_Folder" to the folder... (2 Replies)
Discussion started by: Anupam_Halder
2 Replies

9. Shell Programming and Scripting

Check files and archive the files using sftp

Hi, I have to check the files in another server using sftp to do that, below is the code i am going with #!/bin/bash export SRC_FOLDER=$1 export ARC_FOLDER=$2 HOST=as07u3456 USER=relfag sftp ${USER}@${HOST} <<EOF cd $SRC_FOLDER/DSCOR ls bye EOF echo "done" whatever the files i... (8 Replies)
Discussion started by: ursrami
8 Replies

10. Shell Programming and Scripting

Script to archive logs and sftp to another archive server

Requirement: Under fuse application we have placeholders called containers; Every container has their logs under: <container1>/data/log/fuse.log <container1>/data/log/fuse.log.1 <container1>/data/log/fuse.log.XX <container2>/data/log/fuse.log... (6 Replies)
Discussion started by: Arjun Goswami
6 Replies
PG_RECEIVEXLOG(1)					  PostgreSQL 9.2.7 Documentation					 PG_RECEIVEXLOG(1)

NAME
pg_receivexlog - streams transaction logs from a PostgreSQL cluster SYNOPSIS
pg_receivexlog [option...] DESCRIPTION
pg_receivexlog is used to stream transaction log from a running PostgreSQL cluster. The transaction log is streamed using the streaming replication protocol, and is written to a local directory of files. This directory can be used as the archive location for doing a restore using point-in-time recovery (see Section 24.3, "Continuous Archiving and Point-in-Time Recovery (PITR)", in the documentation). pg_receivexlog streams the transaction log in real time as it's being generated on the server, and does not wait for segments to complete like archive_command does. For this reason, it is not necessary to set archive_timeout when using pg_receivexlog. The transaction log is streamed over a regular PostgreSQL connection, and uses the replication protocol. The connection must be made with a superuser or a user having REPLICATION permissions (see Section 20.2, "Role Attributes", in the documentation), and pg_hba.conf must explicitly permit the replication connection. The server must also be configured with max_wal_senders set high enough to leave at least one session available for the stream. If the connection is lost, or if it cannot be initially established, with a non-fatal error, pg_receivexlog will retry the connection indefinitely, and reestablish streaming as soon as possible. To avoid this behavior, use the -n parameter. OPTIONS
The following command-line options control the location and format of the output. -D directory, --directory=directory Directory to write the output to. This parameter is required. The following command-line options control the running of the program. -n, --no-loop Don't loop on connection errors. Instead, exit right away with an error. -v, --verbose Enables verbose mode. The following command-line options control the database connection parameters. -h host, --host=host Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from the PGHOST environment variable, if set, else a Unix domain socket connection is attempted. -p port, --port=port Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to the PGPORT environment variable, if set, or a compiled-in default. -s interval, --status-interval=interval Specifies the number of seconds between status packets sent back to the server. This is required if replication timeout is configured on the server, and allows for easier monitoring. A value of zero disables the status updates completely. The default value is 10 seconds. -U username, --username=username User name to connect as. -w, --no-password Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password. -W, --password Force pg_receivexlog to prompt for a password before connecting to a database. This option is never essential, since pg_receivexlog will automatically prompt for a password if the server demands password authentication. However, pg_receivexlog will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt. Other options are also available: -V, --version Print the pg_receivexlog version and exit. -?, --help Show help about pg_receivexlog command line arguments, and exit. ENVIRONMENT
This utility, like most other PostgreSQL utilities, uses the environment variables supported by libpq (see Section 31.14, "Environment Variables", in the documentation). NOTES
When using pg_receivexlog instead of archive_command, the server will continue to recycle transaction log files even if the backups are not properly archived, since there is no command that fails. This can be worked around by having an archive_command that fails when the file has not been properly archived yet, for example: archive_command = 'sleep 5 && test -f /mnt/server/archivedir/%f' The initial timeout is necessary because pg_receivexlog works using asynchronous replication and can therefore be slightly behind the master. EXAMPLES
To stream the transaction log from the server at mydbserver and store it in the local directory /usr/local/pgsql/archive: $ pg_receivexlog -h mydbserver -D /usr/local/pgsql/archive SEE ALSO
pg_basebackup(1) PostgreSQL 9.2.7 2014-02-17 PG_RECEIVEXLOG(1)
All times are GMT -4. The time now is 09:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy