This file contains hidden or 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
| #!/bin/sh | |
| now="$(date +'%d_%m_%Y_%H_%M_%S')" | |
| filename="filebak_$now".gz | |
| folder="/path/to/bak" | |
| fullpath="$folder/$filename" | |
| log="$folder/"backup_log_"$(date +'%Y_%m')".txt | |
| files="/source/file/path" | |
| echo "file backup started at $(date +'%d-%m-%Y %H:%M:%S')" >> "$log" | |
| tar -cpzf $fullpath $files | |
| echo "file backup finished at $(date +'%d-%m-%Y %H:%M:%S')" >> "$log" |
This file contains hidden or 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
| #!/bin/sh | |
| now="$(date +'%d_%m_%Y_%H_%M_%S')" | |
| filename="dbbak_$now".gz | |
| folder="/path/to/bak" | |
| fullpath="$folder/$filename" | |
| log="$folder/"backup_log_"$(date +'%Y_%m')".txt | |
| echo "mysqldump started at $(date +'%d-%m-%Y %H:%M:%S')" >> "$log" | |
| mysqldump --user=mydbuser --password=mypass --default-character-set=utf8 mydatabase | gzip > "$fullpath" | |
| echo "mysqldump finished at $(date +'%d-%m-%Y %H:%M:%S')" >> "$log" | |
| echo "*****************" >> "$log" |
This file contains hidden or 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 | |
| /** | |
| * Cotroller action to accept AJAX file upload with S3 bucket set up in Craft Assets | |
| * | |
| * Based on AJAX file upload example by Connor Smith [https://gist.github.com/sathoro] - https://gist.github.com/sathoro/8178981 | |
| * Requires AWS PHP SDK installed and included - http://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/installation.html | |
| * This example used Composer and autoloaded in the init() method to the main plugin's class file | |
| * | |
| **/ |