
نوشته اصلی توسط
Iran Web Host
سلام
کافیه فایلی با پسوند .sh با محتویات زیر ایجاد کنید و در cron هر موقع خواستید اجراش کنید.
اول بکاپ میگیره بعد هم FTP میکنه
کد:
#!/bin/bash
pg_dump IBSng > IBSng_"`date +%Y%m%d`".bak
HOST=hostname
USER=username
PASS=password
ftp -inv $HOST << EOF
user $USER $PASS
put IBSng_"`date +%Y%m%d`".bak
bye
EOF
وقتی من فایلو اجرا میکنم خطا میده و هیچ بکاپی گرفته و اف تی پی نمیشه.
اف تی پی هاست هست.
کد:
pg_dump: [archiver (db)] connection to database "IBSng" failed: FATAL: role "root" does not exist
: command not foundine 2:
: command not foundine 6:
.onnected to 176.9.103.25
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 20:49. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
500 This security scheme is not implemented
500 This security scheme is not implemented
KERBEROS_V4 rejected as an authentication type
Remote system type is UNIX.
Using binary mode to transfer files.
?Invalid command
331 User ****_ OK. Password required
530 Login authentication failed
Login failed.
?Invalid command
remote: IBSng_20121110.bak
530 You aren't logged in
Passive mode refused. Turning off passive mode.
530 You aren't logged in
ftp: bind: Address already in use
?Invalid command
?Invalid command
?Invalid command
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.