schedule auto backup the directories from Centos to FTP server












0















i have three Centos server i want to schedule autobackup some directories to my FTP server ,FTP is already installed in all servers,
i want to use crontab for schedule the backup but the SH files is not working ,i did the bellow configuration at ssh files



#!/bin/sh
ERNAME="user name of my ftp server"
PASSWORD="password of my ftp server"
SERVER="IP of my ftp server "

# local directory to pickup *.tar.gz file
FILE="/usr/log"

# remote server directory to upload backup
BACKUPDIR="/usr/backup"

# login to remote server
ftp -n -i $SERVER <<EOF
user $USERNAME $PASSWORD
cd $BACKUPDIR
mput $FILE/*.tar.gz
quit
EOF


but this configuration is not working.










share|improve this question









New contributor




Sayed mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Can you clarify what is not working

    – Romeo Ninov
    Jan 15 at 13:21











  • When i Run this SH file ,it is not backup my directories which i mentioned for backup

    – Sayed mustafa
    Jan 16 at 4:52











  • What happen if you execute commands one by one. I see you set variable ERNAME, not USERNAME

    – Romeo Ninov
    Jan 16 at 5:29













  • When i execute nothing is happen it not show any error ,but files is also not backuped

    – Sayed mustafa
    Jan 16 at 6:55











  • did you exec commands by hand? ON the same way they are in script, with variables and so on? Did you login successfully in to the server?

    – Romeo Ninov
    Jan 16 at 6:58
















0















i have three Centos server i want to schedule autobackup some directories to my FTP server ,FTP is already installed in all servers,
i want to use crontab for schedule the backup but the SH files is not working ,i did the bellow configuration at ssh files



#!/bin/sh
ERNAME="user name of my ftp server"
PASSWORD="password of my ftp server"
SERVER="IP of my ftp server "

# local directory to pickup *.tar.gz file
FILE="/usr/log"

# remote server directory to upload backup
BACKUPDIR="/usr/backup"

# login to remote server
ftp -n -i $SERVER <<EOF
user $USERNAME $PASSWORD
cd $BACKUPDIR
mput $FILE/*.tar.gz
quit
EOF


but this configuration is not working.










share|improve this question









New contributor




Sayed mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Can you clarify what is not working

    – Romeo Ninov
    Jan 15 at 13:21











  • When i Run this SH file ,it is not backup my directories which i mentioned for backup

    – Sayed mustafa
    Jan 16 at 4:52











  • What happen if you execute commands one by one. I see you set variable ERNAME, not USERNAME

    – Romeo Ninov
    Jan 16 at 5:29













  • When i execute nothing is happen it not show any error ,but files is also not backuped

    – Sayed mustafa
    Jan 16 at 6:55











  • did you exec commands by hand? ON the same way they are in script, with variables and so on? Did you login successfully in to the server?

    – Romeo Ninov
    Jan 16 at 6:58














0












0








0








i have three Centos server i want to schedule autobackup some directories to my FTP server ,FTP is already installed in all servers,
i want to use crontab for schedule the backup but the SH files is not working ,i did the bellow configuration at ssh files



#!/bin/sh
ERNAME="user name of my ftp server"
PASSWORD="password of my ftp server"
SERVER="IP of my ftp server "

# local directory to pickup *.tar.gz file
FILE="/usr/log"

# remote server directory to upload backup
BACKUPDIR="/usr/backup"

# login to remote server
ftp -n -i $SERVER <<EOF
user $USERNAME $PASSWORD
cd $BACKUPDIR
mput $FILE/*.tar.gz
quit
EOF


but this configuration is not working.










share|improve this question









New contributor




Sayed mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












i have three Centos server i want to schedule autobackup some directories to my FTP server ,FTP is already installed in all servers,
i want to use crontab for schedule the backup but the SH files is not working ,i did the bellow configuration at ssh files



#!/bin/sh
ERNAME="user name of my ftp server"
PASSWORD="password of my ftp server"
SERVER="IP of my ftp server "

# local directory to pickup *.tar.gz file
FILE="/usr/log"

# remote server directory to upload backup
BACKUPDIR="/usr/backup"

# login to remote server
ftp -n -i $SERVER <<EOF
user $USERNAME $PASSWORD
cd $BACKUPDIR
mput $FILE/*.tar.gz
quit
EOF


but this configuration is not working.







centos backup ftp






share|improve this question









New contributor




Sayed mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Sayed mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Jan 16 at 9:49









Rui F Ribeiro

39.6k1479132




39.6k1479132






New contributor




Sayed mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Jan 15 at 13:16









Sayed mustafaSayed mustafa

1




1




New contributor




Sayed mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Sayed mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Sayed mustafa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Can you clarify what is not working

    – Romeo Ninov
    Jan 15 at 13:21











  • When i Run this SH file ,it is not backup my directories which i mentioned for backup

    – Sayed mustafa
    Jan 16 at 4:52











  • What happen if you execute commands one by one. I see you set variable ERNAME, not USERNAME

    – Romeo Ninov
    Jan 16 at 5:29













  • When i execute nothing is happen it not show any error ,but files is also not backuped

    – Sayed mustafa
    Jan 16 at 6:55











  • did you exec commands by hand? ON the same way they are in script, with variables and so on? Did you login successfully in to the server?

    – Romeo Ninov
    Jan 16 at 6:58



















  • Can you clarify what is not working

    – Romeo Ninov
    Jan 15 at 13:21











  • When i Run this SH file ,it is not backup my directories which i mentioned for backup

    – Sayed mustafa
    Jan 16 at 4:52











  • What happen if you execute commands one by one. I see you set variable ERNAME, not USERNAME

    – Romeo Ninov
    Jan 16 at 5:29













  • When i execute nothing is happen it not show any error ,but files is also not backuped

    – Sayed mustafa
    Jan 16 at 6:55











  • did you exec commands by hand? ON the same way they are in script, with variables and so on? Did you login successfully in to the server?

    – Romeo Ninov
    Jan 16 at 6:58

















Can you clarify what is not working

– Romeo Ninov
Jan 15 at 13:21





Can you clarify what is not working

– Romeo Ninov
Jan 15 at 13:21













When i Run this SH file ,it is not backup my directories which i mentioned for backup

– Sayed mustafa
Jan 16 at 4:52





When i Run this SH file ,it is not backup my directories which i mentioned for backup

– Sayed mustafa
Jan 16 at 4:52













What happen if you execute commands one by one. I see you set variable ERNAME, not USERNAME

– Romeo Ninov
Jan 16 at 5:29







What happen if you execute commands one by one. I see you set variable ERNAME, not USERNAME

– Romeo Ninov
Jan 16 at 5:29















When i execute nothing is happen it not show any error ,but files is also not backuped

– Sayed mustafa
Jan 16 at 6:55





When i execute nothing is happen it not show any error ,but files is also not backuped

– Sayed mustafa
Jan 16 at 6:55













did you exec commands by hand? ON the same way they are in script, with variables and so on? Did you login successfully in to the server?

– Romeo Ninov
Jan 16 at 6:58





did you exec commands by hand? ON the same way they are in script, with variables and so on? Did you login successfully in to the server?

– Romeo Ninov
Jan 16 at 6:58










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Sayed mustafa is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f494601%2fschedule-auto-backup-the-directories-from-centos-to-ftp-server%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








Sayed mustafa is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Sayed mustafa is a new contributor. Be nice, and check out our Code of Conduct.













Sayed mustafa is a new contributor. Be nice, and check out our Code of Conduct.












Sayed mustafa is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f494601%2fschedule-auto-backup-the-directories-from-centos-to-ftp-server%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?