Re: [GENERAL] Db backup

2017-06-08 Thread John R Pierce

On 6/8/2017 12:29 PM, John R Pierce wrote:

On 6/8/2017 12:10 PM, Jimmy Lunceford wrote:
A windows 7 computer went bad but the hdd is still operable. Is there 
a way to transfer the db data directories to another computer or does 
it require a dump and restore?



the data directories should work as-is on another Windows computer 
with the same major version and 'build' of postgresql and same 32 vs 
64 bitness.   By 'build' I mean like enterpriseDB installer vs BigSQL 
vs custom-built.   if custom built, the build options will need to be 
pretty much the same (visualC vs gcc/mingw vs cygwin, and the same 
general ./configure options, etc etc).



to restore said file system level backup,  I would...

A) install the compatible postgresql build (if the original was 9.3.5, 
its fine to use 9.3.17)


B) stop the postgresql database service

C) replace the 'data' directory with a copy of the data directory from 
the disk of said dead box


D) restart the postgresql database service

E) verify your databases are intact and complete.


if you used custom tablespaces, be sure to restore all those at step C, 
too, qirh the same paths as the originala.



--
john r pierce, recycling bits in santa cruz



Re: [GENERAL] Db backup

2017-06-08 Thread John R Pierce

On 6/8/2017 12:10 PM, Jimmy Lunceford wrote:
A windows 7 computer went bad but the hdd is still operable. Is there 
a way to transfer the db data directories to another computer or does 
it require a dump and restore?



the data directories should work as-is on another Windows computer with 
the same major version and 'build' of postgresql and same 32 vs 64 
bitness.   By 'build' I mean like enterpriseDB installer vs BigSQL vs 
custom-built.   if custom built, the build options will need to be 
pretty much the same (visualC vs gcc/mingw vs cygwin, and the same 
general ./configure options, etc etc).




--
john r pierce, recycling bits in santa cruz



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Db backup

2017-06-08 Thread Joshua D. Drake

On 06/08/2017 12:10 PM, Jimmy Lunceford wrote:
A windows 7 computer went bad but the hdd is still operable. Is there a 
way to transfer the db data directories to another computer or does it 
require a dump and restore?


As long as the data is intact and you use the same major version of 
postgres, yes. Just use robocopy or a standard backup utility.


Thanks,

JD




--

Innerspace Strategies 

Jimmy Lunceford / HVAC Controls 
technicianjimmy_luncef...@innerspacecontrols.com 
(c) 901-825-7643


485 E. South StreetSTE 104Collierville, TN 38017http://issic.net 






--
Command Prompt, Inc.  http://the.postgres.company/
+1-503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Everyone appreciates your honesty, until you are honest with them.
Unless otherwise stated, opinions are my own.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Db backup

2017-06-08 Thread Jimmy Lunceford
A windows 7 computer went bad but the hdd is still operable. Is there a way
to transfer the db data directories to another computer or does it require
a dump and restore?
-- 

[image: Innerspace Strategies] 

Jimmy Lunceford / HVAC Controls
technicianjimmy_luncef...@innerspacecontrols.com(c) 901-825-7643

485 E. South StreetSTE 104Collierville, TN 38017http://issic.net


Re: [GENERAL] db backup script in gentoo

2008-12-01 Thread Andrus

Scott,


OK, find out how to create users on your gentoo server, and see if you
can figure out what's broken in emerge so you can install lftp.  It's
much better than regular ftp, as it has assured transfer completion
and other useful features if you're interested in making sure the file
gets transferred.  Or switch to rsync, which is how I do it.


ftp exists in windows also.
So I can create protable scripts which works in linux/windows probably.
Backup ftp server is located in ISP (probably Debian) which offers ftp and 
http access.

So it seems that I cannot use rsync.

Unresolved is rotating issue:

This script creates different backup file for every weekday containing 
weekday number in name.
ftp account in ISP is public account which allows only to upload files, not 
to overwrite existing ones or download them.

So backup fails after a week if files are not deleted manually.

How to use http POST command to send backup to this server? In this case it 
may be possible to create php script in server which

handles rotating. Or any other idea ?

Andrus. 



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-12-01 Thread Andrus

Reid,

since he noted the distro is '3 years old', odds are the portage tree is 
out of date.


you can try a
 sudo emerge --sync

and then

sudo emerge --ask lftp

note that if a sync has not been done in a long time, many packages may be 
out of date ( possibly why the 'get' of left failed ).  if lftp has 
dependencies, they will most likely have to be rebuilt, and if the 
dependencies have dependencies, etc, etc, etc -- so the results of the 
above emerge could be very large and have a lot of impact.


Will existing PostgreSql 8.1.4 server continue working after running those 
commands ?

Or is there possibility that it stops working ?
Will those commands require re-booting server ?

If ssh/scp are already on the box it might be easier to setup a 
passwordless login configuration and use either scp or sftp to push the 
backup file.


backup ftp server is located in ISP.
It offers ftp and http access only.
So I cannot use scp nor sftp probably.

Andrus. 



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-12-01 Thread Andrus

 sudo emerge --sync


...
deleting xfce-extra/xfce4-weather/files/digest-xfce4-weather-0.4.9
deleting xfce-extra/xfce4-weather/files/digest-xfce4-weather-0.4.1
deleting xfce-extra/xfce4-weather/files/digest-xfce4-weather-0.4.0
deleting xfce-extra/xfce4-weather/files/digest-xfce4-weather-0.3.9.1-r1
deleting xfce-extra/xfce4-weather/files/
deleting xfce-extra/xfce4-weather/xfce4-weather-0.4.9.ebuild
deleting xfce-extra/xfce4-weather/xfce4-weather-0.4.9-r1.ebuild
deleting xfce-extra/xfce4-weather/xfce4-weather-0.4.1.ebuild
deleting xfce-extra/xfce4-weather/xfce4-weather-0.4.0.ebuild
deleting xfce-extra/xfce4-weather/xfce4-weather-0.3.9.1-r1.ebuild
deleting xfce-extra/xfce4-xkb/xfce4-xkb-0.3.5.ebuild
deleting xfce-extra/xfce4-xkb/xfce4-xkb-0.3.2-r2.ebuild
deleting xfce-extra/xfce4-xkb/files/digest-xfce4-xkb-0.3.5
deleting xfce-extra/xfce4-xkb/files/digest-xfce4-xkb-0.3.2-r2

Number of files: 130388
Number of files transferred: 91288
Total file size: 169664640 bytes
Total transferred file size: 148443324 bytes
Literal data: 148443324 bytes
Matched data: 0 bytes
File list size: 3196842
File list generation time: 12.983 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 2125704
Total bytes received: 156054763

sent 2125704 bytes  received 156054763 bytes  195889.12 bytes/sec
total size is 169664640  speedup is 1.07


Updating Portage cache:  100%



Performing Global Updates: /usr/portage/profiles/updates/3Q-2004
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  @='/var/db move'
 s='/var/db SLOT move' S='binary SLOT move' p='update 
/etc/portage/package.*'

...


Performing Global Updates: /usr/portage/profiles/updates/1Q-2005
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  @='/var/db move'
 s='/var/db SLOT move' S='binary SLOT move' p='update 
/etc/portage/package.*'

.


Performing Global Updates: /usr/portage/profiles/updates/3Q-2005
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  @='/var/db move'
 s='/var/db SLOT move' S='binary SLOT move' p='update 
/etc/portage/package.*'

..


Performing Global Updates: /usr/portage/profiles/updates/4Q-2006
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  @='/var/db move'
 s='/var/db SLOT move' S='binary SLOT move' p='update 
/etc/portage/package.*'

.


Performing Global Updates: /usr/portage/profiles/updates/1Q-2007
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  @='/var/db move'
 s='/var/db SLOT move' S='binary SLOT move' p='update 
/etc/portage/package.*'

.


Performing Global Updates: /usr/portage/profiles/updates/2Q-2007
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  @='/var/db move'
 s='/var/db SLOT move' S='binary SLOT move' p='update 
/etc/portage/package.*'

..


Performing Global Updates: /usr/portage/profiles/updates/3Q-2007
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  @='/var/db move'
 s='/var/db SLOT move' S='binary SLOT move' p='update 
/etc/portage/package.*'




Performing Global Updates: /usr/portage/profiles/updates/4Q-2007
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  @='/var/db move'
 s='/var/db SLOT move' S='binary SLOT move' p='update 
/etc/portage/package.*'

.


Performing Global Updates: /usr/portage/profiles/updates/1Q-2008
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  @='/var/db move'
 s='/var/db SLOT move' S='binary SLOT move' p='update 
/etc/portage/package.*'




Performing Global Updates: /usr/portage/profiles/updates/2Q-2008
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  @='/var/db move'
 s='/var/db SLOT move' S='binary SLOT move' p='update 
/etc/portage/package.*'

.


Performing Global Updates: /usr/portage/profiles/updates/3Q-2008
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  @='/var/db move'
 

Re: [GENERAL] db backup script in gentoo

2008-12-01 Thread Malinka Rellikwodahs
On Mon, Dec 1, 2008 at 12:04, Andrus [EMAIL PROTECTED] wrote:

  sudo emerge --sync


 * An update to portage is available. It is _highly_ recommended
 * that you update portage now, before any other packages are updated.
 * Please run 'emerge portage' and then update ALL of your
 * configuration files.
 * To update portage, run 'emerge portage'.

 root ~ # emerge portage
 !!! ARCH is not set... Are you missing the '/etc/make.profile' symlink?
 !!! Is the symlink correct? Is your portage tree complete?

 So it seems that emerge portage fails.
 Also I do'nt understand this:


your /usr/portage directory is probably not mounted properly check that
again and then check /etc/make.profile points to a valid directory which
will be something along the lines of
/usr/portage/profiles/default-linux/arch/version

for example on one of my old amd64 boxes it's

/usr/portage/profiles/default-linux/amd64/2007.0


Re: [GENERAL] db backup script in gentoo

2008-12-01 Thread Andrus
your /usr/portage directory is probably not mounted properly check that 
again and then check /etc/make.profile points to a valid directory which 
will be something along the lines of

/usr/portage/profiles/default-linux/arch/version


jomanda etc # ls /etc/make.profile -l
lrwxrwxrwx 1 root root 48 19. juuni  2006 /etc/make.profile - 
../usr/portage/profiles/default-linux/x86/2006.0

jomanda etc # ls -l ../usr/portage/profiles/default-linux/x86/2006.0
ls: ../usr/portage/profiles/default-linux/x86/2006.0: No such file or 
directory

jomanda etc # ls -l ../usr/portage/profiles/default-linux/x86/2007.0
kokku 12
drwxr-xr-x 2 root root  54 14. apr2007 desktop
-rw-r--r-- 1 root root 486  8. aug2007 make.defaults
-rw-r--r-- 1 root root 664 14. apr2007 packages
-rw-r--r-- 1 root root   3 14. apr2007 parent
drwxr-xr-x 2 root root  60 14. apr2007 server
jomanda amd64 # emerge portage
Calculating dependencies... done!

!!! Error: the sys-apps/portage-2.1.4_rc1 package conflicts with another 
package;

!!!the two packages cannot be installed on the same system together.
!!!Please use 'emerge --pretend' to determine blockers.

For more information about Blocked Packages, please refer to the following
section of the Gentoo Linux x86 Handbook (architecture is irrelevant):

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#blocked

jomanda etc # emerge portage

!!! Your current profile is deprecated and not supported anymore.
!!! Please upgrade to the following profile if possible:
   default/linux/x86/2008.0

To upgrade do the following steps:
# cd /etc/
# rm make.profile
# ln -s ../usr/portage/profiles/default/linux/x86/2008.0 make.profile


Calculating dependencies... done!

!!! Error: the sys-apps/portage-2.1.4_rc1 package conflicts with another 
package;

!!!the two packages cannot be installed on the same system together.
!!!Please use 'emerge --pretend' to determine blockers.

For more information about Blocked Packages, please refer to the following
section of the Gentoo Linux x86 Handbook (architecture is irrelevant):

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#blocked

jomanda etc # cd /etc/
jomanda etc # rm make.profile
jomanda etc # ln -s ../usr/portage/profiles/default/linux/x86/2008.0 
make.profile

jomanda etc # emerge portage
Traceback (most recent call last):
 File /usr/bin/emerge, line 4049, in ?
   emerge_main()
 File /usr/bin/emerge, line 3768, in emerge_main
   settings, trees, mtimedb = load_emerge_config()
 File /usr/bin/emerge, line 3679, in load_emerge_config
   trees = portage.create_trees(trees=trees, **kwargs)
 File /usr/lib/portage/pym/portage.py, line 6780, in create_trees
   config_incrementals=portage_const.INCREMENTALS)
 File /usr/lib/portage/pym/portage.py, line 902, in __init__
   addProfile(os.path.realpath(self.profile_path))
 File /usr/lib/portage/pym/portage.py, line 889, in addProfile
   raise portage_exception.ParseError(
NameError: global name 'parents_file' is not defined

Andrus.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-12-01 Thread Malinka Rellikwodahs
as previously said you need to go to http://forums.gentoo.org/

On Mon, Dec 1, 2008 at 13:16, Andrus [EMAIL PROTECTED] wrote:

 your /usr/portage directory is probably not mounted properly check that
 again and then check /etc/make.profile points to a valid directory which
 will be something along the lines of
 /usr/portage/profiles/default-linux/arch/version


 jomanda etc # ls /etc/make.profile -l
 lrwxrwxrwx 1 root root 48 19. juuni  2006 /etc/make.profile -
 ../usr/portage/profiles/default-linux/x86/2006.0
 jomanda etc # ls -l ../usr/portage/profiles/default-linux/x86/2006.0
 ls: ../usr/portage/profiles/default-linux/x86/2006.0: No such file or
 directory
 jomanda etc # ls -l ../usr/portage/profiles/default-linux/x86/2007.0
 kokku 12
 drwxr-xr-x 2 root root  54 14. apr2007 desktop
 -rw-r--r-- 1 root root 486  8. aug2007 make.defaults
 -rw-r--r-- 1 root root 664 14. apr2007 packages
 -rw-r--r-- 1 root root   3 14. apr2007 parent
 drwxr-xr-x 2 root root  60 14. apr2007 server
 jomanda amd64 # emerge portage
 Calculating dependencies... done!

 !!! Error: the sys-apps/portage-2.1.4_rc1 package conflicts with another
 package;
 !!!the two packages cannot be installed on the same system
 together.
 !!!Please use 'emerge --pretend' to determine blockers.

 For more information about Blocked Packages, please refer to the following
 section of the Gentoo Linux x86 Handbook (architecture is irrelevant):

 http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#blocked

 jomanda etc # emerge portage

 !!! Your current profile is deprecated and not supported anymore.
 !!! Please upgrade to the following profile if possible:
   default/linux/x86/2008.0

 To upgrade do the following steps:
 # cd /etc/
 # rm make.profile
 # ln -s ../usr/portage/profiles/default/linux/x86/2008.0 make.profile


 Calculating dependencies... done!

 !!! Error: the sys-apps/portage-2.1.4_rc1 package conflicts with another
 package;
 !!!the two packages cannot be installed on the same system
 together.
 !!!Please use 'emerge --pretend' to determine blockers.

 For more information about Blocked Packages, please refer to the following
 section of the Gentoo Linux x86 Handbook (architecture is irrelevant):

 http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#blocked

 jomanda etc # cd /etc/
 jomanda etc # rm make.profile
 jomanda etc # ln -s ../usr/portage/profiles/default/linux/x86/2008.0
 make.profile
 jomanda etc # emerge portage
 Traceback (most recent call last):
  File /usr/bin/emerge, line 4049, in ?
   emerge_main()
  File /usr/bin/emerge, line 3768, in emerge_main
   settings, trees, mtimedb = load_emerge_config()
  File /usr/bin/emerge, line 3679, in load_emerge_config
   trees = portage.create_trees(trees=trees, **kwargs)
  File /usr/lib/portage/pym/portage.py, line 6780, in create_trees
   config_incrementals=portage_const.INCREMENTALS)
  File /usr/lib/portage/pym/portage.py, line 902, in __init__
   addProfile(os.path.realpath(self.profile_path))
  File /usr/lib/portage/pym/portage.py, line 889, in addProfile
   raise portage_exception.ParseError(
 NameError: global name 'parents_file' is not defined

 Andrus.




Re: [GENERAL] db backup script in gentoo

2008-11-30 Thread Andrus

Are you using ftp or lftp? lftp is much more scriptable / controllable
than regular ftp.


I'm using ftp as shown in script.
typing lftp shows that this is not found but locate shows something.
How to use lftp in this 3-year old gentoo ?
Where to find sample script for thos task ?

Andrus.

pg_log # lftp
bash: lftp: command not found
pg_log # locate lftp
/var/cache/edb/dep/usr/portage/net-fs/curlftpfs-0.9
/var/cache/edb/dep/usr/portage/net-ftp/lftp-3.5.6
/var/cache/edb/dep/usr/portage/net-ftp/lftp-3.5.4
/var/cache/edb/dep/usr/portage/net-ftp/glftpd-1.32-r2
/var/cache/edb/dep/usr/portage/net-ftp/glftpd-2.01
/var/cache/edb/dep/usr/portage/net-ftp/glftpd-2.00
/var/cache/edb/dep/usr/portage/net-ftp/lftp-3.4.6
/usr/portage/metadata/cache/net-ftp/glftpd-2.00
/usr/portage/metadata/cache/net-ftp/glftpd-2.01
/usr/portage/metadata/cache/net-ftp/lftp-3.4.6
/usr/portage/metadata/cache/net-ftp/glftpd-1.32-r2
/usr/portage/metadata/cache/net-ftp/lftp-3.5.4
/usr/portage/metadata/cache/net-ftp/lftp-3.5.6
/usr/portage/metadata/cache/net-fs/curlftpfs-0.9
/usr/portage/net-ftp/lftp
/usr/portage/net-ftp/lftp/Manifest
/usr/portage/net-ftp/lftp/files
/usr/portage/net-ftp/lftp/files/lftp-3.4.6-nossl.patch
/usr/portage/net-ftp/lftp/files/digest-lftp-3.4.6
/usr/portage/net-ftp/lftp/files/digest-lftp-3.5.4
/usr/portage/net-ftp/lftp/files/digest-lftp-3.5.6
/usr/portage/net-ftp/lftp/lftp-3.4.6.ebuild
/usr/portage/net-ftp/lftp/ChangeLog
/usr/portage/net-ftp/lftp/metadata.xml
/usr/portage/net-ftp/lftp/lftp-3.5.4.ebuild
/usr/portage/net-ftp/lftp/lftp-3.5.6.ebuild
/usr/portage/net-ftp/glftpd
/usr/portage/net-ftp/glftpd/Manifest
/usr/portage/net-ftp/glftpd/files
/usr/portage/net-ftp/glftpd/files/glftpd-2.00-install.patch
/usr/portage/net-ftp/glftpd/files/digest-glftpd-1.32-r2
/usr/portage/net-ftp/glftpd/files/glftpd-2.01-install.patch
/usr/portage/net-ftp/glftpd/files/digest-glftpd-2.00
/usr/portage/net-ftp/glftpd/files/digest-glftpd-2.01
/usr/portage/net-ftp/glftpd/files/glftpd.xinetd.d
/usr/portage/net-ftp/glftpd/files/glftpd.env.d
/usr/portage/net-ftp/glftpd/files/glftpd-2.00-script-path-checks.patch
/usr/portage/net-ftp/glftpd/files/1.32-install.patch
/usr/portage/net-ftp/glftpd/files/glftpd-2.00-gcc.patch
/usr/portage/net-ftp/glftpd/files/1.32-stack-overflow.patch
/usr/portage/net-ftp/glftpd/glftpd-2.01.ebuild
/usr/portage/net-ftp/glftpd/glftpd-1.32-r2.ebuild
/usr/portage/net-ftp/glftpd/glftpd-2.00.ebuild
/usr/portage/net-ftp/glftpd/ChangeLog
/usr/portage/net-fs/curlftpfs
/usr/portage/net-fs/curlftpfs/Manifest
/usr/portage/net-fs/curlftpfs/files
/usr/portage/net-fs/curlftpfs/files/digest-curlftpfs-0.9
/usr/portage/net-fs/curlftpfs/ChangeLog
/usr/portage/net-fs/curlftpfs/metadata.xml
/usr/portage/net-fs/curlftpfs/curlftpfs-0.9.ebuild


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-11-30 Thread Scott Marlowe
On Sun, Nov 30, 2008 at 3:17 AM, Andrus [EMAIL PROTECTED] wrote:
 Are you using ftp or lftp? lftp is much more scriptable / controllable
 than regular ftp.

 I'm using ftp as shown in script.
 typing lftp shows that this is not found but locate shows something.
 How to use lftp in this 3-year old gentoo ?
 Where to find sample script for thos task ?

Sorry, I'm no gentoo expert.  It's certainly not the first distro I'd
recommend to someone just starting out with linux / unix.  Time to
break out the google.  I also found quite a few example scripts for
lftp with google in a few minutes.

here's a simple one.

open myftp.ftp.com
user username password
cd /some_directory/
mv textfile.tar Finishedtextfile.tar
get Finishedtextfile.tar

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-11-30 Thread Andrus

Sorry, I'm no gentoo expert.  It's certainly not the first distro I'd
recommend to someone just starting out with linux / unix.  Time to
break out the google.  I also found quite a few example scripts for
lftp with google in a few minutes.


I must manage existing gentoo server where previous maintainer has left
company.
lftp is not found in gentoo and nobody knows how to activate it. So I must
use existing ftp.
This issue may not realted to ftp program.
I verified multiple times that file exists and is readable.
Any ides why ftp does not find /root/my-backups/mybackup6.backup ? There
must be something simple.
Can /root directoy access from fpt program is disabled for some strange
reason ?

ftp server log contains (ip and names changed):


23:50:20 (2008-11-29) z12.zone.com [ftp.debug] pure-ftpd: ([EMAIL PROTECTED])
[DEBUG] Command [user] [d11551f21768]
23:50:20 (2008-11-29) z12.zone.com [ftp.debug] pure-ftpd:
([EMAIL PROTECTED]) [DEBUG] Command [pwd] []
23:50:20 (2008-11-29) z12.zone.com [ftp.debug] pure-ftpd:
([EMAIL PROTECTED]) [DEBUG] Command [type] [I]
23:50:20 (2008-11-29) z12.zone.com [ftp.debug] pure-ftpd:
([EMAIL PROTECTED]) [DEBUG] Command [pasv] []
23:50:20 (2008-11-29) z12.zone.com [ftp.debug] pure-ftpd:
([EMAIL PROTECTED]) [DEBUG] Command [stor]
[/root/my-backups/mybackup6.backup]
23:50:20 (2008-11-29) z12.zone.com [ftp.err] pure-ftpd:
([EMAIL PROTECTED]) [ERROR] Can\'t open that file: No such file or
directory
23:50:20 (2008-11-29) z12.zone.com [ftp.err] pure-ftpd:
([EMAIL PROTECTED]) [ERROR] Rename/move failure: No such file or
directory
23:50:20 (2008-11-29) z12.zone.com [ftp.debug] pure-ftpd:
([EMAIL PROTECTED]) [DEBUG] Command [quit] []
23:50:20 (2008-11-29) z12.zone.com [ftp.info] pure-ftpd:
([EMAIL PROTECTED]) [INFO] Logout.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-11-30 Thread Scott Marlowe
On Sun, Nov 30, 2008 at 1:18 PM, Andrus [EMAIL PROTECTED] wrote:
 Sorry, I'm no gentoo expert.  It's certainly not the first distro I'd
 recommend to someone just starting out with linux / unix.  Time to
 break out the google.  I also found quite a few example scripts for
 lftp with google in a few minutes.

 I must manage existing gentoo server where previous maintainer has left
 company.
 lftp is not found in gentoo and nobody knows how to activate it. So I must
 use existing ftp.

It sounds like the last guy there was no gentoo expert either.
Apparently the install command is something like

emerge lftp

but I can't confirm that, since I'm not sitting on a gentoo box.

 This issue may not realted to ftp program.
 I verified multiple times that file exists and is readable.
 Any ides why ftp does not find /root/my-backups/mybackup6.backup ? There

Because ftp is running as a cron?  Doesn't have the right permissions?
 Because it appeared the username and password were failing?  Because
ftp wasn't designed to be scriptable?  Maybe a lack of EOF in the
original example you posted.  Could be a lot of reasons.

 must be something simple.
 Can /root directoy access from fpt program is disabled for some strange
 reason ?

What?  Only root can access /root directory.  Or do you mean something
else?  Only things that should be run by root are things that
genuinely need to, and this doesn't look like one of them.

 [/root/my-backups/mybackup6.backup]

Looks like you're trying to write to the /root directory.  Don't do that.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-11-30 Thread Reid Thompson

Scott Marlowe wrote:

On Sun, Nov 30, 2008 at 1:18 PM, Andrus [EMAIL PROTECTED] wrote:

Sorry, I'm no gentoo expert.  It's certainly not the first distro I'd
recommend to someone just starting out with linux / unix.  Time to
break out the google.  I also found quite a few example scripts for
lftp with google in a few minutes.

I must manage existing gentoo server where previous maintainer has left
company.
lftp is not found in gentoo and nobody knows how to activate it. So I must
use existing ftp.


It sounds like the last guy there was no gentoo expert either.
Apparently the install command is something like

emerge lftp


sudo emerge lftp

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-11-30 Thread Andrus

Scott,


emerge lftp


root # emerge lftp
Calculating dependencies... done!


Emerging (1 of 1) net-ftp/lftp-3.4.6 to /
Downloading 'http://distfiles.gentoo.org/distfiles/lftp-3.4.6.tar.gz'

--23:39:28--  http://distfiles.gentoo.org/distfiles/lftp-3.4.6.tar.gz
  = `/usr/portage/distfiles/lftp-3.4.6.tar.gz'
Lahendan distfiles.gentoo.org... 64.50.236.52, 64.50.238.52, 
140.211.166.134, ...
Loon C¼hendust serveriga distfiles.gentoo.org|64.50.236.52|:80... C¼hendus 
loodud.

HTTP pC¤ring saadetud, ootan vastust... 404 Not Found
23:39:29 VIGA 404: Not Found.

Downloading 
'http://distro.ibiblio.org/pub/linux/distributions/gentoo/distfiles/lftp-3.4.6.tar.gz'
--23:39:29--  
http://distro.ibiblio.org/pub/linux/distributions/gentoo/distfiles/lftp-3.4.6.tar.gz

  = `/usr/portage/distfiles/lftp-3.4.6.tar.gz'
Lahendan distro.ibiblio.org... 152.46.7.109
Loon C¼hendust serveriga distro.ibiblio.org|152.46.7.109|:80... C¼hendus 
loodud.

HTTP pC¤ring saadetud, ootan vastust... 404 Not Found
23:39:31 VIGA 404: Not Found.


Downloading 'ftp://lftp.yar.ru/lftp/old/lftp-3.4.6.tar.gz'

--23:39:31--  ftp://lftp.yar.ru/lftp/old/lftp-3.4.6.tar.gz
  = `/usr/portage/distfiles/lftp-3.4.6.tar.gz'
Lahendan lftp.yar.ru... 193.233.48.99
Loon C¼hendust serveriga lftp.yar.ru|193.233.48.99|:21... ebaCµnnestus: 
Connection refused.

!!! Couldn't download 'lftp-3.4.6.tar.gz'. Aborting.


Because ftp is running as a cron?  Doesn't have the right permissions?


I ran script from command line as root.
Running from cron does not also upload copy. since I used cron -e as root, 
script runs probably in cron also as root.



Because it appeared the username and password were failing?
Maybe a lack of EOF in the
original example you posted.  Could be a lot of reasons.


This script tries to write to /root/my-backup directory in ftp server which 
fails.

I fixed this and now it works.
There is no EOF in script but it still works.

Thank you very much for quick help, it was really useful!


What?  Only root can access /root directory.  Or do you mean something
else?  Only things that should be run by root are things that
genuinely need to, and this doesn't look like one of them.
Looks like you're trying to write to the /root directory.  Don't do that.


There are no console users in this server other than root. /home directory 
is empty.

console access is used only some times in year.

Andrus. 



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-11-30 Thread Scott Marlowe
On Sun, Nov 30, 2008 at 3:16 PM, Andrus [EMAIL PROTECTED] wrote:
 Scott,

 emerge lftp

 root # emerge lftp
 Calculating dependencies... done!

 Emerging (1 of 1) net-ftp/lftp-3.4.6 to /
 Downloading 'http://distfiles.gentoo.org/distfiles/lftp-3.4.6.tar.gz'

 --23:39:28--  http://distfiles.gentoo.org/distfiles/lftp-3.4.6.tar.gz
  = `/usr/portage/distfiles/lftp-3.4.6.tar.gz'
 Lahendan distfiles.gentoo.org... 64.50.236.52, 64.50.238.52,
 140.211.166.134, ...
 Loon C¼hendust serveriga distfiles.gentoo.org|64.50.236.52|:80... C¼hendus
 loodud.
 HTTP pC¤ring saadetud, ootan vastust... 404 Not Found
 23:39:29 VIGA 404: Not Found.

 Downloading
 'http://distro.ibiblio.org/pub/linux/distributions/gentoo/distfiles/lftp-3.4.6.tar.gz'

 --23:39:29--
  
 http://distro.ibiblio.org/pub/linux/distributions/gentoo/distfiles/lftp-3.4.6.tar.gz
  = `/usr/portage/distfiles/lftp-3.4.6.tar.gz'
 Lahendan distro.ibiblio.org... 152.46.7.109
 Loon C¼hendust serveriga distro.ibiblio.org|152.46.7.109|:80... C¼hendus
 loodud.
 HTTP pC¤ring saadetud, ootan vastust... 404 Not Found
 23:39:31 VIGA 404: Not Found.

 Downloading 'ftp://lftp.yar.ru/lftp/old/lftp-3.4.6.tar.gz'

 --23:39:31--  ftp://lftp.yar.ru/lftp/old/lftp-3.4.6.tar.gz
  = `/usr/portage/distfiles/lftp-3.4.6.tar.gz'
 Lahendan lftp.yar.ru... 193.233.48.99
 Loon C¼hendust serveriga lftp.yar.ru|193.233.48.99|:21... ebaCµnnestus:
 Connection refused.
 !!! Couldn't download 'lftp-3.4.6.tar.gz'. Aborting.

Sounds like your install of gentoo is broken somehow.  I'd check a
gentoo support forum for help, or wait and see if someone here knows
it well enough to help you out.

 Because ftp is running as a cron?  Doesn't have the right permissions?

 I ran script from command line as root.
 Running from cron does not also upload copy. since I used cron -e as root,
 script runs probably in cron also as root.

Don't do that.  Create an extra account on both machines with a
password set to something you know and use that.  If they're both unix
/ linux boxes look into using rsync, which is much more stable, just
setup a set of ssh keys on the machine that's running rsync and put
them in authorized_keys file on the destination.  google it, there's
lots of howtos on that.

 Because it appeared the username and password were failing?
 Maybe a lack of EOF in the
 original example you posted.  Could be a lot of reasons.

 This script tries to write to /root/my-backup directory in ftp server which
 fails.
 I fixed this and now it works.
 There is no EOF in script but it still works.

OK, find out how to create users on your gentoo server, and see if you
can figure out what's broken in emerge so you can install lftp.  It's
much better than regular ftp, as it has assured transfer completion
and other useful features if you're interested in making sure the file
gets transferred.  Or switch to rsync, which is how I do it.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-11-30 Thread Guy Rouillier

Andrus wrote:
There are no console users in this server other than root. /home 
directory is empty.

console access is used only some times in year.


Andrus, I don't know how this conversation ended up on a PG mailing 
list, but Gentoo maintains many user forums where people are happy to 
answer questions about that distro: http://www.gentoo.org


--
Guy Rouillier

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] db backup script in gentoo

2008-11-29 Thread Andrus
How to create automated backup script in Gentoo which in every night 3:00 PM 
backups one database and sends backup

with ftp using unique file name?

In windows I can use scheduler and script

set FILENAME=%DATE:~8,4%%DATE:~5,2%%DATE:~2,2%MyDbBackup
pg_dump -Z6 -b -v -f %FILENAME%.backup -F c -h localhost -U postgres mydb
ftp -send -u username -p password  %FILENAME%.backup  ftp.backupserver.com

I have few experience in Linux. How to convert this to Gentoo Linux ?

Andtus 



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-11-29 Thread Alan Hodgson
On Saturday 29 November 2008, Andrus [EMAIL PROTECTED] wrote:
 How to create automated backup script in Gentoo which in every night 3:00
 PM backups one database and sends backup
 with ftp using unique file name?

 In windows I can use scheduler and script

 set FILENAME=%DATE:~8,4%%DATE:~5,2%%DATE:~2,2%MyDbBackup
 pg_dump -Z6 -b -v -f %FILENAME%.backup -F c -h localhost -U postgres
 mydb ftp -send -u username -p password  %FILENAME%.backup 
 ftp.backupserver.com

 I have few experience in Linux. How to convert this to Gentoo Linux ?

Investigate the date command, shell scripting in general, the ncftp program 
(specifically its ncftpput command), and cron.

If you're that unfamiliar with Linux, though, I would very strongly suggest 
not using Gentoo.


-- 
Alan

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-11-29 Thread Uwe C. Schroeder

On Saturday 29 November 2008, Andrus wrote:
 How to create automated backup script in Gentoo which in every night 3:00
 PM backups one database and sends backup
 with ftp using unique file name?

 In windows I can use scheduler and script

 set FILENAME=%DATE:~8,4%%DATE:~5,2%%DATE:~2,2%MyDbBackup
 pg_dump -Z6 -b -v -f %FILENAME%.backup -F c -h localhost -U postgres mydb
 ftp -send -u username -p password  %FILENAME%.backup 
 ftp.backupserver.com

Write a shell script that you store someplace you know (i.e. your database 
users home directory)

say you name it: /home/whoever/mybackup.sh

#!/bin/sh
cd /someplace/to/store/backups
pg_dump -Fc -R -O -i -Upostgres mydb  mydb_backup`date +'%Y%m%d'`.sql
[FTP STUFF GOES HERE - see below]

save the file. Do a chmod 755 /home/whoever/mybackup.sh

type crontab -e being logged in as the user who should run this script 
(whoever in the example above)
In the edior add a line like
0 3 * * * /home/whoever/mybackup.sh

save.

Now you'd just have to figure out the ftp part, because I use rdist to push 
the copies to a backup machine.

HTH
Uwe



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-11-29 Thread Scott Marlowe
On Sat, Nov 29, 2008 at 12:39 PM, Uwe C. Schroeder [EMAIL PROTECTED] wrote:
 Now you'd just have to figure out the ftp part, because I use rdist to push
 the copies to a backup machine.

Look up lftp.  It's a very capable scriptable ftp client with
automatic retry etc...  also does ssl.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-11-29 Thread Andrus

Uwe,

thank you very much. I created script and ran it from command line:

#!/bin/sh
PGUSER=postgres
PGPASSWORD=password
export PGUSER PGPASSWORD
backupdir=/root/my-backups
backupdate=$(date +%u)
backupfile=${backupdir}/mybackup${backupdate}.backup
pg_dump -Fc -b -Z6 mydb ${backupfile}
/usr/bin/ftp -inp EOF
debug 10
hash off
tick on
open myftpsite.com
user   myuser mypass
pwd
bin
verbose
remotestatus
lcd /root/my-backups
put ${backupfile}
stat
bye

PGUSER=
PGPASSWORD=
export PGUSER PGPASSWORD

file /root/my-backups/mybackup6.backup  is created:

ls -l /root/my-backups/mybackup6.backup
-rw-r--r-- 1 root root 3155454 30. nov   00:06 
/root/my-backups/mybackup6.backup


ftp upload failed:

Output from script:

Debugging on (debug=10).
Hash mark printing on (1024 bytes/hash mark).
Hash mark printing off.
Tick counter printing on (10240 bytes/tick increment).
--- SYST
--- USER myuser
--- PASS 
?Invalid command
?Invalid command
--- PWD
257 / is your current location
--- TYPE I
Verbose mode on.
?Invalid command
Local directory now /root/my-backups
local: /root/my-backups/mybackup6.backup remote:
/root/my-backups/mybackup6.backup
--- PASV
227 Entering Passive Mode (195,222,29,12,236,175)
--- STOR /root/my-backups/mybackup6.backup
553-Can't open that file: No such file or directory
553 Rename/move failure: No such file or directory
Connected tomyftpsite.com.
No proxy connection.
Mode: stream; Type: binary; Form: non-print; Structure: file
Verbose: on; Bell: off; Prompting: off; Globbing: on
Store unique: off; Receive unique: off
Case: off; CR stripping: on
Ntrans: off
Nmap: off
Hash mark printing: off; Use of PORT cmds: on
Tick counter printing: on
--- QUIT
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.


Why created fiel is not found ?
How to fix ?

Andrus.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] db backup script in gentoo

2008-11-29 Thread Scott Marlowe
On Sat, Nov 29, 2008 at 3:23 PM, Andrus [EMAIL PROTECTED] wrote:
 Uwe,

 thank you very much. I created script and ran it from command line:

 #!/bin/sh
 PGUSER=postgres
 PGPASSWORD=password
 export PGUSER PGPASSWORD
 backupdir=/root/my-backups
 backupdate=$(date +%u)
 backupfile=${backupdir}/mybackup${backupdate}.backup
 pg_dump -Fc -b -Z6 mydb ${backupfile}
 /usr/bin/ftp -inp EOF
 debug 10
 hash off
 tick on
 open myftpsite.com
 user   myuser mypass
 pwd
 bin
 verbose
 remotestatus
 lcd /root/my-backups
 put ${backupfile}
 stat
 bye

 PGUSER=
 PGPASSWORD=
 export PGUSER PGPASSWORD

 file /root/my-backups/mybackup6.backup  is created:

 ls -l /root/my-backups/mybackup6.backup
 -rw-r--r-- 1 root root 3155454 30. nov   00:06
 /root/my-backups/mybackup6.backup

 ftp upload failed:

 Output from script:

Are you using ftp or lftp? lftp is much more scriptable / controllable
than regular ftp.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general