Crontab database backup files - no such file or directory












-1














When creating SQL database backups, using the following cron job:



50 3 * * * date=date -I; /usr/bin/mysqldump -uroot -pPASSWORD auth > /home/server/backup/auth$date.sql


I cannot download the backup whereas if the backup is manually initiated via SSH (either direct or through a bash file), I can.



Although I use the root user for both cron and logging onto the ftp server using FileZilla,I get:




"/home/server/backup/auth2018-12-30.sql: open for read: no such file or directory".




I've attempted to change the user:group used by the cronjob, but nothing seems to be working.



Does anyone have any ideas what might be causing it?










share|improve this question




















  • 1




    Usually the issue is differences in the environment variables - without more details from you (the actual crontab + any scripts it spawns; the complete error message) it's going to be hard to be more specific
    – steeldriver
    Jan 2 at 2:59










  • @steeldriver I'm not sure posting the crontab will help because, as I mention above, when I execute the command via SSH I am able to download it with no problem. The crontab is : 50 3 * * * date=date -I; /usr/bin/mysqldump -uroot -pPASSWORD auth > /home/server/backup/auth$date.sql
    – Nipper
    Jan 2 at 3:43












  • Please edit your question to provide all relevant information there as the comments can get quite messy. ;-) also please explain where FileZilla comes in? Explain the entire process as it looks like your remote user just cannot see a file created by root (which is what happens when you crontab stuff.) After having edited, leave a comment @Fabby
    – Fabby
    Jan 2 at 16:59












  • Thanks @Fabby. I added extra detail to the main question.
    – Nipper
    Jan 3 at 11:54










  • -pPASSWORD?! wtf is that? Please use proper methods. See dev.mysql.com/doc/refman/8.0/en/password-security-user.html And I would assume -p with password is nowadays invalid(??) I get an error when I use that on command line.
    – Rinzwind
    Jan 3 at 12:02


















-1














When creating SQL database backups, using the following cron job:



50 3 * * * date=date -I; /usr/bin/mysqldump -uroot -pPASSWORD auth > /home/server/backup/auth$date.sql


I cannot download the backup whereas if the backup is manually initiated via SSH (either direct or through a bash file), I can.



Although I use the root user for both cron and logging onto the ftp server using FileZilla,I get:




"/home/server/backup/auth2018-12-30.sql: open for read: no such file or directory".




I've attempted to change the user:group used by the cronjob, but nothing seems to be working.



Does anyone have any ideas what might be causing it?










share|improve this question




















  • 1




    Usually the issue is differences in the environment variables - without more details from you (the actual crontab + any scripts it spawns; the complete error message) it's going to be hard to be more specific
    – steeldriver
    Jan 2 at 2:59










  • @steeldriver I'm not sure posting the crontab will help because, as I mention above, when I execute the command via SSH I am able to download it with no problem. The crontab is : 50 3 * * * date=date -I; /usr/bin/mysqldump -uroot -pPASSWORD auth > /home/server/backup/auth$date.sql
    – Nipper
    Jan 2 at 3:43












  • Please edit your question to provide all relevant information there as the comments can get quite messy. ;-) also please explain where FileZilla comes in? Explain the entire process as it looks like your remote user just cannot see a file created by root (which is what happens when you crontab stuff.) After having edited, leave a comment @Fabby
    – Fabby
    Jan 2 at 16:59












  • Thanks @Fabby. I added extra detail to the main question.
    – Nipper
    Jan 3 at 11:54










  • -pPASSWORD?! wtf is that? Please use proper methods. See dev.mysql.com/doc/refman/8.0/en/password-security-user.html And I would assume -p with password is nowadays invalid(??) I get an error when I use that on command line.
    – Rinzwind
    Jan 3 at 12:02
















-1












-1








-1







When creating SQL database backups, using the following cron job:



50 3 * * * date=date -I; /usr/bin/mysqldump -uroot -pPASSWORD auth > /home/server/backup/auth$date.sql


I cannot download the backup whereas if the backup is manually initiated via SSH (either direct or through a bash file), I can.



Although I use the root user for both cron and logging onto the ftp server using FileZilla,I get:




"/home/server/backup/auth2018-12-30.sql: open for read: no such file or directory".




I've attempted to change the user:group used by the cronjob, but nothing seems to be working.



Does anyone have any ideas what might be causing it?










share|improve this question















When creating SQL database backups, using the following cron job:



50 3 * * * date=date -I; /usr/bin/mysqldump -uroot -pPASSWORD auth > /home/server/backup/auth$date.sql


I cannot download the backup whereas if the backup is manually initiated via SSH (either direct or through a bash file), I can.



Although I use the root user for both cron and logging onto the ftp server using FileZilla,I get:




"/home/server/backup/auth2018-12-30.sql: open for read: no such file or directory".




I've attempted to change the user:group used by the cronjob, but nothing seems to be working.



Does anyone have any ideas what might be causing it?







mysql backup cron sql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 at 17:05









Fabby

26.5k1360159




26.5k1360159










asked Jan 2 at 2:56









NipperNipper

11




11








  • 1




    Usually the issue is differences in the environment variables - without more details from you (the actual crontab + any scripts it spawns; the complete error message) it's going to be hard to be more specific
    – steeldriver
    Jan 2 at 2:59










  • @steeldriver I'm not sure posting the crontab will help because, as I mention above, when I execute the command via SSH I am able to download it with no problem. The crontab is : 50 3 * * * date=date -I; /usr/bin/mysqldump -uroot -pPASSWORD auth > /home/server/backup/auth$date.sql
    – Nipper
    Jan 2 at 3:43












  • Please edit your question to provide all relevant information there as the comments can get quite messy. ;-) also please explain where FileZilla comes in? Explain the entire process as it looks like your remote user just cannot see a file created by root (which is what happens when you crontab stuff.) After having edited, leave a comment @Fabby
    – Fabby
    Jan 2 at 16:59












  • Thanks @Fabby. I added extra detail to the main question.
    – Nipper
    Jan 3 at 11:54










  • -pPASSWORD?! wtf is that? Please use proper methods. See dev.mysql.com/doc/refman/8.0/en/password-security-user.html And I would assume -p with password is nowadays invalid(??) I get an error when I use that on command line.
    – Rinzwind
    Jan 3 at 12:02
















  • 1




    Usually the issue is differences in the environment variables - without more details from you (the actual crontab + any scripts it spawns; the complete error message) it's going to be hard to be more specific
    – steeldriver
    Jan 2 at 2:59










  • @steeldriver I'm not sure posting the crontab will help because, as I mention above, when I execute the command via SSH I am able to download it with no problem. The crontab is : 50 3 * * * date=date -I; /usr/bin/mysqldump -uroot -pPASSWORD auth > /home/server/backup/auth$date.sql
    – Nipper
    Jan 2 at 3:43












  • Please edit your question to provide all relevant information there as the comments can get quite messy. ;-) also please explain where FileZilla comes in? Explain the entire process as it looks like your remote user just cannot see a file created by root (which is what happens when you crontab stuff.) After having edited, leave a comment @Fabby
    – Fabby
    Jan 2 at 16:59












  • Thanks @Fabby. I added extra detail to the main question.
    – Nipper
    Jan 3 at 11:54










  • -pPASSWORD?! wtf is that? Please use proper methods. See dev.mysql.com/doc/refman/8.0/en/password-security-user.html And I would assume -p with password is nowadays invalid(??) I get an error when I use that on command line.
    – Rinzwind
    Jan 3 at 12:02










1




1




Usually the issue is differences in the environment variables - without more details from you (the actual crontab + any scripts it spawns; the complete error message) it's going to be hard to be more specific
– steeldriver
Jan 2 at 2:59




Usually the issue is differences in the environment variables - without more details from you (the actual crontab + any scripts it spawns; the complete error message) it's going to be hard to be more specific
– steeldriver
Jan 2 at 2:59












@steeldriver I'm not sure posting the crontab will help because, as I mention above, when I execute the command via SSH I am able to download it with no problem. The crontab is : 50 3 * * * date=date -I; /usr/bin/mysqldump -uroot -pPASSWORD auth > /home/server/backup/auth$date.sql
– Nipper
Jan 2 at 3:43






@steeldriver I'm not sure posting the crontab will help because, as I mention above, when I execute the command via SSH I am able to download it with no problem. The crontab is : 50 3 * * * date=date -I; /usr/bin/mysqldump -uroot -pPASSWORD auth > /home/server/backup/auth$date.sql
– Nipper
Jan 2 at 3:43














Please edit your question to provide all relevant information there as the comments can get quite messy. ;-) also please explain where FileZilla comes in? Explain the entire process as it looks like your remote user just cannot see a file created by root (which is what happens when you crontab stuff.) After having edited, leave a comment @Fabby
– Fabby
Jan 2 at 16:59






Please edit your question to provide all relevant information there as the comments can get quite messy. ;-) also please explain where FileZilla comes in? Explain the entire process as it looks like your remote user just cannot see a file created by root (which is what happens when you crontab stuff.) After having edited, leave a comment @Fabby
– Fabby
Jan 2 at 16:59














Thanks @Fabby. I added extra detail to the main question.
– Nipper
Jan 3 at 11:54




Thanks @Fabby. I added extra detail to the main question.
– Nipper
Jan 3 at 11:54












-pPASSWORD?! wtf is that? Please use proper methods. See dev.mysql.com/doc/refman/8.0/en/password-security-user.html And I would assume -p with password is nowadays invalid(??) I get an error when I use that on command line.
– Rinzwind
Jan 3 at 12:02






-pPASSWORD?! wtf is that? Please use proper methods. See dev.mysql.com/doc/refman/8.0/en/password-security-user.html And I would assume -p with password is nowadays invalid(??) I get an error when I use that on command line.
– Rinzwind
Jan 3 at 12:02












0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1106148%2fcrontab-database-backup-files-no-such-file-or-directory%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
















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • 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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2faskubuntu.com%2fquestions%2f1106148%2fcrontab-database-backup-files-no-such-file-or-directory%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

Human spaceflight

Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

File:DeusFollowingSea.jpg