Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Ok, so I'm doing this via my webhost (oktagone). Through Cpanel's UI to crontab. I'm using this script to create a backup of my MySQL database hourly for the times I can't be there to do it myself, I want it time stamped so files are not overwritten (incase the database get's f'ed up, I don't want the backup to be that of a f'ed database).
Ok, the problem is, the file name contains an illegal char (at least I assume that). I can't delete it, rename it, nothing. I'm going to email them and ask them to do it for me (since they can by inode) I assume that the date variable has a line break character after it, anyone know for sure? I think I may need to add something to remove the illegal char from the date variable, but I'm not sure what the illegal char is, or how to do that. :/
Anyway, if someone could help me rectify this problem, that would be great. I would email them but they'll probably just say "We can have a technician write/correct your script for $30/hour" like they did last time. It's probably a simple fix to those more familier with linux.
Also, the script is being run with the command "/bin/sh /home/thugg/sqlbackup.sh", and I know it's executing (there's about 8 of these backups I can't do s**t with).
Originally posted by Tinkster
[B]Fist of all, congratulations to your foul language,
we don't see that very often these places.
Yeah, sorry about that, it's my normal everyday language.
Since I don't have a shell access via telnet or something else, It's not easy for me to do ls, I would have to do it as a cron job that outputs to a file so I can read it. As for the man pages I've read a few. I mainly went off of mysqldump at mysql.com. It's where I originally found the $date thing. I'll read the other ones, though I don't want to tar the output, I just wanted to exactly the same as cpanel does it (and so for the mysqldump command with those options is exactly that, aswell as the gzip). I just wanted it automated and time stamped so It would never overwrite.
NOTE: The reason for the line break is because the output has the line break char in the file name, so it is infact the line break character. Also I cropped the output to this single line, 'tis all that's needed.
Now I hope all I need is a line to remove the line break from the $date variable, can anyone help me with that? (I've searched quite a bit today, I only found, err 'stuff' for perl and html).
I will test, but I assume it shall work. I've been messing with tr too, doesn't want to work for me, but I think my syntax was off, and I didn't try it using a pipe.
Hmm, well this time the date is there, but the linebreak is still after it, followed by the extension (which I can't see via FTP because the I can't see anything after the line break. I tried replacing the \\012 with \n, but neither worked.
I'm begining to think maybe this is hopeless, but then again I'm by no means optimistic. Or at least that the $30/hour isn't such a rip-off.
Thanks for your help though, and if you have any more ideas, just let me know.
Ok, now there's no more return characters or anything wierd like that in the name, but FTP says can't find file (no such file or directory), and cpanel's filemanager says can't stat file, because it doesn't exist. Lol.
ls -lia /home/thugg/* output:
Code:
4088877 -rw-r--r-- 1 thugg thugg 495552 Dec 19 21:43 /home/thugg/ibforums-2003-12-19.gz
I also tried `date +%d%m%y%k%M` incase for some odd reason it was the hyphens, still no luck. File is right there, but it says it can't find it when I try to do anything with it via FTP or cpanel's file manager.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.