Last active
August 25, 2016 14:55
-
-
Save HaykoKoryun/a16b8aea86c726d02bd4 to your computer and use it in GitHub Desktop.
async gzip on server with email notification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$background = "> /dev/null 2>/dev/null &"; | |
$input = ""; | |
$output = ""; | |
$email = "bob@bob.com"; | |
$subject = "$output done"; | |
$cwd = getcwd(); | |
exec("(mail -s 'zipping up stuff in $input, will let you know when done...' $email) $background"); | |
exec("(tar -zcvf $output $input; mail -s '$subject' $email) $background"); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment