Skip to content

Instantly share code, notes, and snippets.

@onocom
Created July 12, 2017 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onocom/6141ec4b2a0b7667446c4735b295afea to your computer and use it in GitHub Desktop.
Save onocom/6141ec4b2a0b7667446c4735b295afea to your computer and use it in GitHub Desktop.
<?php
$PATH_TARGET = "/PATH/TO/TARGET/";
$PATH_SAVE = "/PATH/TO/SAVE/";
// zip name
$file_name = "backup.zip";
$command = "
cd ". $PATH_TARGET ."
zip -qr ". $PATH_SAVE . $file_name ." . ";
// Linuxコマンドの実行
echo exec($command);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment