Last active
January 29, 2020 21:44
-
-
Save z3nth10n/31da46ffbb938fdfdbb4b3f9dc5b64df to your computer and use it in GitHub Desktop.
Revisions
-
z3nth10n revised this gist
Jan 29, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1 +1,3 @@ Add this file to crontab using `crontab -e`. There is a online generator: https://crontab-generator.org/ Use Task Scheduler on Windows 10 to execute the script: https://active-directory-wp.com/docs/Usage/How_to_add_a_cron_job_on_Windows.html -
z3nth10n revised this gist
Jan 29, 2020 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ @echo off rmdir /S / Q <target-folder> pscp -P <port> -pw <password> -r <user>@<host>:<source-folder> <target-folder> :: Example: :: pscp -P 12345 -pw 1234 -r [email protected]:/var/ftp/backup-admin debian-mv-z3nth10n-net -
z3nth10n revised this gist
Jan 29, 2020 . 2 changed files with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ Add this file to crontab using `crontab -e`. There is a online generator: https://crontab-generator.org/ 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 charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,8 @@ rm /var/ftp/backup-admin/backup.tar.gz rm /var/ftp/backup-admin/.bash_history rm -rf /var/ftp/backup-admin/logs tar czf /var/ftp/backup-admin/backup.tar.gz /var/www cp ~/.bash_history /var/ftp/backup-admin/bash_history cp -R /var/log/apache2 /var/ftp/backup-admin/logs mysqldump --defaults-extra-file="/var/crons/mysql/.database.cnf" -u administrador --all-databases > /var/ftp/backup-admin/all_databases.sql -
z3nth10n created this gist
Jan 29, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ #!/bin/bash # https://stackoverflow.com/questions/19904992/mysqldump-without-password-in-crontab rm /var/ftp/backup-admin/backup.tar.gz rm /var/ftp/backup-admin/.bash_history tar czf /var/ftp/backup-admin/backup.tar.gz /var/www cp ~/.bash_history /var/ftp/backup-admin/.bash_history mysqldump --defaults-extra-file="/var/crons/mysql/.database.cnf" -u administrador --all-databases > /var/ftp/backup-admin/all_databases.sql