overclucker Posted February 7, 2009 Share Posted February 7, 2009 i would like to be able to make a snapshot of my current school work progress, for later reference, right from the student web server. the code below, i adapted to the absolute paths on my home pc. I also am unaware of what indentation method is prefered for small php scripts. i already tested if test.php is viewable on the sws. i'm guessing there is a better way to bzip a dir in php, words of advice would be much appreciated. thanks. #!/usr/bin/env php <?php $stamp = date('Y-m-d-H-i'); $snappieces = array('/home/oc/Documents/PCC-', $stamp, '.bz2'); $snapname = implode('', $snappieces); $snaptarget = fopen('/home/oc/Documents/PCC', 'r'); $snap = bzopen($snapname, 'w'); bzwrite($snap, $snaptarget); bzclose($snap); ?> Link to comment https://forums.phpfreaks.com/topic/144186-making-timestamped-bzip2-snapshots/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.