Ubuntu :: Add Date Suffix To File Name During MySQL Dump?
Mar 17, 2010
I have a script (below) which works ok, but I have tried to modify it as I want to keep the older files for a restore if needed. I have tried adding a date suffix to the newly created files (second lump of code), but it doesn't seem to work.I get the error:
$SOURCEDIR/p1db_$DATEVAR.sql: ambiguous redirect
The working original script:
Code:
#!/bin/bash[code].....
View 1 Replies
ADVERTISEMENT
Mar 20, 2011
I have a problem with a script i wrote, the script runs fine if manually executed however it doesn't run *fully* when executed via cron
here's the script :
Code:
#!/bin/bash
FILENAME=mysql_full_dump_`date '+%m.%d.%y'`.sql
`which mysqldump` --all-databases -uroot -p************ -h127.0.0.1 > /root/$FILENAME
RETVAL=$?
[code]....
the script resides in /root/bin and the cron entry is as follows:
Code:
0 0 * * * root "/root/bin/mysql_daily.sh"
the result is the .sql file, but it doesn't archive it.
View 2 Replies
View Related
Sep 23, 2010
I am manually backing up my server now with mysqldump and that works but I was wondering about mechanizing the process.
Nirvana would be to dump to a file named with the date
This way I have backups going back over time
View 9 Replies
View Related
May 25, 2010
When i load the local .csv file into mysql server the date format varies.Its mis matching.How to solve and match this.
View 1 Replies
View Related
Oct 7, 2009
I want to generate core dump files from my program when it crashes. Its a pretty big process and has about 10-11 threads in it.I have followed the documentation to enable core dump by setting ulimit to unlimited etc. I quickly tried "A demo program creating a core dump" from the following webpage, which succeeds in Segfault and dumping a core file in the directory that I configured.However, I tried running my original program and caused it to crash. I did this by making calls to kill(), raise() or the same null pointer access as shown in the webpage above. In each case, my program crashed but did not generate a core dump file. Am I missing something?My program is in C++ and my environment is Redhat 9.0 (kernel 2.4.20)
Going through the "Why do I NOT get a core dump?" section on the same webpage as above, I can see two potential problems. One - there are issues with the suid/sgid (bullet # 6). I am not able to change any settings with suid because my system does not contain either /proc/sys/fs/suid_dumpable or /proc/sys/kernel/suid_dumpableTwo, my program has threads in it and the bullet # 8 is the problem.
View 1 Replies
View Related
Dec 1, 2009
As you know everywhere we create a new file ,immediately a backup file with suffix ~ will be created with it if we open the file , i deleted a file but always i have problem with its backup how can delete them with deleting the file?
View 7 Replies
View Related
Aug 8, 2010
I've got a Centos 5 machine running with a raid 1 SSD hard drive combo, as I don't know how or even if it's possible yet to wipe the free disk space clean I need to be careful to not fill all the free disk space. As I don't want to fill the free disk space too quickly and was wandering if it is possible to pipe the result of a mysqldump to a FTP client only writing it to the ram and not writing it to this disk.
I've done a bit of research on the subject and have found the two following commands:
Code: mysqldump < mysqldump options> | gzip > outputfile.sql.gz
Code: tar cf - / | ncftpput -c sonic.sega.co.jp /usr/local/backup.tar
I would like to combine the two to make something like this:
Code: mysqldump mysqldump_options > | ncftpput ncftpput_options -c SERVER_IP backup.sql
I haven't actually tried my code as it seems too easy and I'm sure I've got something wrong! If this command is even correct will it prevent the sql file from being written to the hard drive to my local machine?
View 4 Replies
View Related
Dec 11, 2010
Does anyone have a simple to use bash script or some such that will convert MSSQL dump files to MySQL formatted dump files?
View 6 Replies
View Related
Jun 14, 2011
Is there a way to gunzip a file that isn't ending with a .zip even though I know for a fact the file is indeed a zip?
View 2 Replies
View Related
Jul 12, 2010
I would really like to preserve a file's original modified date and pass it back to the file as the same attribute after a script has worked on it. I get a lot of JPEG files from different places on the Net which I either turn around and upload or burn to disk, and having the "original" date of either download or last mod in a graphics app would be for me, in the long run, a lot more helpful when deciding, for instance, which files to "recycle" or pass on backing up more than once.I've tried doing this on my own every now and then. Where I run into problems is that it appears "stat" and "date" use different formats for date information, and I can't seem to puzzle out how to "translate" one to the other satisfactorily for the latter command.
Just to give an example:
stat foo.jpg |grep Modify gives me
Modify: 2010-07-12 06:28:56.890625000 -0400
Passing that string as-is to date foo.jpg, I get the errordate: unknown option -- 0 and the usual semi-courteous suggestion to Try 'date --help' for more information.Somehow my TexInfo database got screwed up somewhere along the line and info dategives me the short article on date input formats, not the full documentation for the command
View 4 Replies
View Related
Mar 12, 2010
I am using CRON to create a new, blank file, every minute, in a specific location on my web server. After web searching, and reading man pages, I get the impression that the following command is supposed to work:touch /home/mydomain/var/folder/attachments/`date +%H%M`.txtThis should give me a new file with a file name that is the current hour and minute.However, when executed, the CRON mailer reports:touch /home/mydomain/var/folder/attachments/`date +/bin/sh: -c: line 0: unexpected EOF while looking for matching /bin/sh: -c: line 1: syntax error: unexpected end of fileSo, it looks like shell is seeing the plus (+) sign as an EOFObviously, nothing get created.What would be the easiest, single line command to create an empty file, at a given location, with a time based file name
View 5 Replies
View Related
Sep 5, 2010
Trying to take a UK formatted date (30/12/2010) and insert it into Mysql (2010-12-30) is just not going to plan. I have a feeling I'm getting close, however it's just not working out.
Code:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$unformatted_date = $_POST['date'];
$formatted_date = substr($unformatted_date,6,4) . "-" . substr($unformatted_date,3,2) . "-" . substr($unformatted_date,0,2);
[Code]....
View 3 Replies
View Related
Jun 30, 2011
I'm actually tryinng to order all by DATE on MySQL but seems not to be possible.The date order is like this for example: Wednesday, June 29, 2011, 18:31I tried with this, but doesn't work:SELECT * FROM members ORDER BY date ASCSometimes it works with DESC.And also with this, and same!SELECT * STR_TO_DATE( date, '%D, %M %d, %Y, %H:%M' ) AS date_for_sort FROM `members` ORDER BY date_for_sort;I have this problem and I need to fix it asap for the business.
View 2 Replies
View Related
Feb 18, 2010
I got a backup file which first 1000 bytes are as follows:
Code:
00000000 54 41 50 45 00 00 03 00 8c 00 0e 01 00 00 00 00 |TAPE............|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000030 02 00 87 05 51 64 50 48 01 00 00 00 01 00 00 00 |....QdPH........|
[code]....
I tried to restore it:
Code:
$ restore -r -f zzz_labxxxx
Checksum error 32615101403, inode 0 file (null)
restore: Tape is not a dump tape
What application could I use or even try? The man who made the backup can't be reached anymore and we had been left with the backup.
View 1 Replies
View Related
Jun 26, 2011
I want to insert a acess log file to mysql table.
my log file look like this;
08/Apr/2011 10:51:19 http://v4.netlogstatic.com/v6.00/385...t.messenger.js
08/Apr/2011 10:51:19 http://download.windowsupdate.com/ms...536945da07.exe
08/Apr/2011 10:51:19 http://www.google.lk/search?
08/Apr/2011 10:51:19 http://clients1.google.lk/generate_204
[Code].....
i want to insert this in to a table which having datetime (as it is in log file) and the site visited.
I created a mysql table using DATE using the date type and the TIME suing time type.but once i loaded this log to table date field shows empty. like following.
| 0000-00-00 | 04:18:29 | http://www.espncricinfo.com/navigati...scorecard.css?
how can I solve this problem.your responses are highly. My table should look like the following
| 08/Apr/2011 | 10:51:19 | http://www.radioeksen.com/song.txt
View 1 Replies
View Related
Jul 27, 2011
I have two different table in a database in mysql that has no share key with each other and I want to sort them with each other on their date time column I mean when I sort it row X of table A that is older that row Y of table B comes earlier.
View 3 Replies
View Related
Feb 22, 2011
So I've got a rather vast database, one of the columns is date in the following format: DD/MM/YY HH:MM:SS. This is starting to cause problems with a php page I'm writing which asks the user for a 'start date'. Would it be better for me to split the date column into date and say time? Or is there a way of using distinct and masking the times.
View 10 Replies
View Related
Sep 6, 2010
I have used Dump Command to dump the application files. For Full backup the level 0 is working fine. For incremental backup I used the level 1 or 2 it is getting the error as
DUMP: Only level 0 dumps are allowed on a subdirectory
DUMP: The ENTIRE dump is aborted.
The code I used
===============================
#!/bin/bash
#Full Day Backup Script
#application folders backup
#test is the username
now=$(date +"%d-%m-%Y")
[Code]...
View 2 Replies
View Related
Oct 21, 2009
How to create a dump of an existing file and how to restore it with command line?
View 6 Replies
View Related
May 13, 2010
We are going through the motions of testing the backup and restore configurations of our postgres database. One idea was testing the viability of the dump file. Does anyone know of a way of testing the dump file to determine if there is any corruption in it
View 2 Replies
View Related
Jan 24, 2011
I just switched from a basic digital camera to a more advanced one that stores both Jpeg and Raw (.Nef - it's a Nikon) files for me.When importing files in Digikam, I rename the files so that they start with Date and Time. Example: 20110121-223748.JPG for a photo taken on Jan 21st 2011 at 22:37:48.I was a bit surprised when importing both the JPEG and the Raw version of the same photo, that the filename is different by a few seconds (no constant offset, sometimes they are the same):
20110121-223748.JPG
20110121-223750.NEF
I did some "research" by looking at the exif data of both files (using "exiftool 20110121-223748.JPG" from the command line). Here is what I got back
(amongst other data):20110121-223748.JPG
File Modification Date/Time : 2011:01:21 22:37:48+01:00
Modify Date : 2011:01:21 22:37:48
Date/Time Original : 2011:01:21 22:37:48
[code]....
So it seems that Digikam is using the "File Modification Date/Time" (different in the Jpeg's and Raw's of my camera) rather than the "Create Date" (the same for both Jpeg and Raw). (The few seconds difference in "File Modification Date/Time" between the two versions of the same photo is probably due to the time that my camera needs to write away the data on the SD memory card. I guess.) Is there a way to have Digikam use the Create Date? (Or the Date/Time Original?)
PS: I'm on Ubuntu 10.04LTS, using DigiKam 1.2.0
View 1 Replies
View Related
Jul 1, 2011
Doing this: mplayer dvd://1 -v -dumpstream -dumpfile dump.vob Gives me all the audio tracks, but not the subtitles. How can I go about getting the subtitles to be included in the file dump.vob? I've tried something like: mplayer dvd://1 -v -sid 5 -dumpstream -dumpfile dump.vob (where -sid 5 was the correct subtitle) but this does not work. I'm going to use mencoder to make an .avi file (with subtiutles, obviously), so I could, as a last resort, use some other program that extracts the subtitles (suggestions?).
View 3 Replies
View Related
Dec 15, 2008
I'm having trouble trying to get a thread dump for tomcat. I have tried the following and none seems to work:
kill -3 <pid>
kill -QUIT <pid>
killall -3 java
Nothing shows up on screen. I also tried putting the out of the dump to a file with the > command but the file is blank.
View 5 Replies
View Related
May 22, 2010
Does the dump command back up entire file-systems or is it capable of backing up subsets of a file-system? And is tar capable of taking device names (for file systems) as input to be archived?
View 1 Replies
View Related
Nov 12, 2009
i just touch linux, may i know how can i convert the core dump file to a readable textfile, which include all the information, which is in core dump, such as all variables, threads information, call trace for each tasks, and so on. i know use the GDB can view this, but it won't dump all the informations to one text file. but sometimes, people want to view the core dump reason without Linux environment.
View 2 Replies
View Related
Feb 5, 2009
I thought that the problem is in the phpMyAdmin not in the mysql. But now i think different. It seems that the problem is right in the mysql. I think that there was no root user, when mysql was freshly installed. Unfortunately i did everything i can find on internet (some tutorials) but they don`t helped me at all, maybe i fu**ed up the mysql service. So i reinstalled it, and when i want to start it there is no file mysql.sock and i get the following:
linux-nepg:~ # service mysql restart
Restarting service MySQL
Shutting down service MySQL done
Starting service MySQL warning: /var/lib/mysql/mysql.sock didn't appear within 30 seconds
View 9 Replies
View Related
Jan 11, 2010
I need to get the modified date on a file in linux to use in a script.I tried using 'ls -l' on the file, but this caused problems when the date turned from a single digit into a double. The reason for the problem was because I was parsing the result string on spaces.How can I get the date of the last time a file was modified so I can use it in a script? For example, if a file was modified on 1/11/2010, I need the 11.
View 2 Replies
View Related
Feb 24, 2010
I want to add suffix or prefix in all files (.txt , .avi . , .exe)from a folder
View 9 Replies
View Related
Dec 19, 2009
what does kernel suffix mean?After OS installation and supplementary product installation I am discovering a set of boot alternatives and corresponding kernel versions. They have different suffixes: -pae, -default, -trace.
It appears that kernel *-pae is booting normally,while kernel *-default hungs in the middle of booting process being unable to discover certain disk or partition.Some products also have similar suffixes: -pae, -trace,-default. What does it mean? Shall I keep kernels that do not boot?
View 1 Replies
View Related
Dec 26, 2010
I was setting up a new Linux box and router today and when I was looking to see if my custom DNS servers were being handed off in DHCP to my Ubuntu box I realized that the isp was shoving down onto my machines their dns suffix. Since I have configured my dhcp scope in the router to hand out a local dns suffix I am not sure why my suffix is not being used. Is there a way to use the .local dns suffix for both my linux and windows machines with dhcp instead of having to manually set the suffix?
View 3 Replies
View Related