NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Create checkpoint


Joined: 26 Jan 2009
Posts: 12
Reply with quote
I wrote a script that lets you make a quick backup of a file from within the PhpED editor. This is useful for code thats not in a repository or for quick-and-dirty backups.

in Integration, add a menu called "Make Checkpoint"

Execute with Shell, enter the command line as shown below.
Code:

"@php5@" -n -f c:\_scripts\checkpointer.php -- "@FName@"




Check "Show this command in File Bar popup" as well, if you wish.

how to set it up:
    Make the directory c:\_scripts\

    Create the file c:\_scripts\checkpointer.php

Code:

<?php

$file = $argv[1];
if (empty($file)) {
   echo "No File Specified";
   sleep(10);
   exit();
}

$nf = str_replace(":","",$file);
//add any other filename abbreviations here
$nf = str_replace(" ","",$nf);
$nf = strtolower(preg_replace('/[^a-zA-Z0-9_]/','.',$nf)).date("YmdHis").".7z";
while (strlen($nf) > 255) {
 $nf = substr($nf, 1);
}
$newfile = "C:\\_scripts\\checkpoints\\".$nf;
$arg = "a $newfile \"$file\"";
system("c:\\_scripts\\checkpoints\\7za.exe $arg");


    make the directory c:\_scripts\checkpoints\

    Download 7zip executable (freeware, available here: http://www.7-zip.org/download.html ) - make sure you get the command line version, and place 7za.exe in the c:\_scripts\checkpoints\ directory.

    right click a file or directory and choose "Make Checkpoint" to make a quick backup of the file.
View user's profileFind all posts by pineappleclockSend private messageVisit poster's website
Backup


Joined: 01 Aug 2007
Posts: 14
Location: Elmshorn, Germany
Reply with quote
Hello,

thank you for the script.

I want to share something for backing up files, too. Not a script - just a tip.

I am working a lot online via FTP / SFTP. phpEd stores the opened files temporarily in the users directory, local settings, temp directory (on XP, other OS-Versions may be different). There are a lot of backup-programms available that can be run in the background and save files to zip's. I use Ascomp backupmaker to save all changed *.php files in the temp folder recursive to a zip every 15 minutes. This way i have the different steps of my work saved. Even if i recognize an error or loose my file after hours of work i can go back to a working version.

Maybe this helps some users...

Thomas
View user's profileFind all posts by tkahlSend private messageVisit poster's website


Joined: 29 Nov 2012
Posts: 1
Reply with quote
Check points:
Code:
<?php

$file = $argv[1];
if (empty($file)) {
   echo "No File Specified";
   sleep(10);
   exit();
}

$nf = str_replace(":","",$file);
//add any other filename abbreviations here
$nf = str_replace(" ","",$nf);
$nf = strtolower(preg_replace('/[^a-zA-Z0-9_]/','.',$nf)).date("YmdHis").".7z";
while (strlen($nf) > 255) {
 $nf = substr($nf, 1);
}




________________________
Dentalhealthblog.eu


Last edited by zeeshan on Thu Jan 31, 2013 3:29 am; edited 5 times in total
View user's profileFind all posts by zeeshanSend private message
Create checkpoint
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic