backup

Build Tar file from directory in PHP without exec/passthru

女生的网名这么多〃 提交于 2019-11-30 12:36:23
So I have a client who's current host does not allow me to use tar via exec()/passthru()/ect and I need to backup the site periodicly and programmaticly so is there a solution? This is a linux server. PHP 5.3 offers a much easier way to solve this issue. Look here: http://www.php.net/manual/en/phardata.buildfromdirectory.php <?php $phar = new PharData('project.tar'); // add all files in the project $phar->buildFromDirectory(dirname(__FILE__) . '/project'); ?> At http://pear.php.net/package/Archive_Tar you can donload the PEAR tar package and use it like this to create the archive: <?php

How to pg_restore

最后都变了- 提交于 2019-11-30 11:51:49
I am dumping my database 'mydatabase' into a text file 'mydatabase.sql' through command line. "C:/Program Files (x86)/PostgreSQL/9.1/bin/pg_dump.exe " --host localhost --port 5432 --username "postgres" --no-password --verbose --file "C:\Users\User 1\Desktop\mydatabase.sql" "mydatabase" Thas' going nice. But after many tries I can't do a pg_restore those file back to database with data. But if I delete all tables in this database I can do it with: psql -f "C:\Users\User 1\Desktop\mydatabase.sql" "mydatabase" "postgres" This recover's all data. Problem is that I can't run pgsl through VBNET

PHP Recursive Backup Script

試著忘記壹切 提交于 2019-11-30 11:40:23
问题 I wrote a basic content-management system for my website, including an administration panel. I understand basic file IO as well as copying via PHP, but my attempts at a backup script callable from the script have failed. I tried doing this: //... authentication, other functions for(scandir($homedir) as $buffer){ if(is_dir($buffer)){ //Add $buffer to an array } else{ //Back up the file } } for($founddirectories as $dir){ for(scandir($dir) as $b){ //Backup as above, adding to $founddirectories

backup and restore ALL resharper settings

大兔子大兔子 提交于 2019-11-30 11:24:23
问题 How can I backup and later restore (after a clean install) ALL resharper settings? 回答1: On XP Resharper stores its settings in: %userprofile%\Application Data\JetBrains\ReSharper\[R# Version]\[VS Version] and of Vista/7: %userprofile%\AppData\Roaming\JetBrains\ReSharper\[R# Version]\[VS Version] where [R# Version] is the version of ReSharper installed (e.g. v4.5) and [VS Version] is your Visual Studio version (e.g. vs9.0). Just copy all the files from that folder to backup, and put them back

MySQL Database backup automatically on a windows server

不打扰是莪最后的温柔 提交于 2019-11-30 11:21:01
问题 Is there a way to back up MySQL database automatically at certain times of the day for designated servers or send an email with an attachment.. Which ever do you think is the best and safest way to achieve this? 回答1: I would use Windows Task Scehduler/cron (depending on your system) and mysqldump. Scroll down in the link, it includes some insights how to achieve what you want. 回答2: Best way to do this would be mysqldump.exe --user=YourUserName --password=YourPassword --host=localhost --port

GIT clone to external drive for backup

霸气de小男生 提交于 2019-11-30 10:36:31
问题 We have GIT set up within our windows network (using msysgit & GitExtensions). We each have our own repositories and we push to a remote 'bare' repository on one of our servers. All good. I'm trying to set up a scheduled job on the server, which will clone a repository from the C drive to an external drive (on F) - having some difficulty getting this to work. I can do this in GIT bash relatively easily, but I'm not sure how to save this into a batch file that I can then scehdule. What I have

Where are data files of elasticsearch on a standard debian install?

主宰稳场 提交于 2019-11-30 08:28:58
Now I'm in a very problematic situation... My data server has been hacked and now I can't request my elasticsearch server by curl or any other method. I have a bunch of very critical data which was not yet backuped (2 days late, hell, I didn't see the alert that backup failed). I've tried to restart the service but no way, it say nothing and I get nothing in processes when I'm watching with ps. I think that comes from my hoster which runs my server in a secure mode... So I tried to locate the physical files but I didn't find them. I've a non-customized install so in my config file, I have this

sql server restoring back up error

耗尽温柔 提交于 2019-11-30 07:49:29
I have backed up a database I had created on an other machine running SQL server 2012 express edition and I wanted to restore it on my machine, which is running the same. I have ticked the checkbox overwriting existing one, and got this error: Backup mediaset is not complete. Files: D:\question.bak. Family count:2. Missing family sequence number:1 This happens if, when you made the backup, you had multiple files listed in the backup destination textbox. Go back to your source server and create the backup again; this time, make sure there's only one destination file listed. If you had more than

PHP Database Dump Script - are there any issues?

烂漫一生 提交于 2019-11-30 07:41:24
问题 I found a PHP function to dump a mySQL database that someone else had written, and then cleaned it up and formatted it a bit. I wanted to know if I could get a critique of it. I have ran it, tested it on a Wordpress blog and the DB completely restores, but wanted to get some other eyes on the code. Specifically I am looking for feedback on: Anything that could corrupt the data - not properly escaping etc Violating any best practice / principles Security issues Anything else you may see as an

Using backup database programmatically

一世执手 提交于 2019-11-30 07:19:16
How can I use a .bak database backup file (backed up via a query in SQL Server ) programmatically? I want my application to back up my database to a location (which I can already do) and I also want it to be able to load a backed up database (the .bak file). How can I do this using C#? marc_s You need to first make sure you have the SMO (SQL Server Management Objects) installed and available to you on your dev box. This is typically the case, if you have installed some version of SQL Server on it. If you have the SMO library available, you can use this code snippet for your operation: using