debian_common

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
debian_common [2024/03/12 07:53] โ€“ [Watchlist for backup] Jรบne Parkdebian_common [2024/04/18 07:49] โ€“ [Major LTS upgrade] Jรบne Park
Line 40: Line 40:
 /opt/scripts/  /opt/scripts/ 
 </code> </code>
 +
 +**update-motd** 
 +<code bash>
 +/etc/update-motd.d/
 +</code>
 +
 +**crontab** 
 +<code bash> 
 +sudo crontab -l 
 +sudo -u www-data crontab -l 
 +crontab -l 
 +</code>
 +
 **MariaDB** ''per DATABASE'' **MariaDB** ''per DATABASE''
 +=== Backup MariaDB DATABASE === 
  
-----+<code bash> ย 
 +/usr/bin/mysqldump --single-transaction -h localhost -u root -p[database_passwd] [database_name] > /..(path)../.backup/[database_name]-sqlbkp_`date +"%Y%m%d"`.bakย 
 +</code> ย 
 +ย 
 +---- ย 
 +ย 
 +=== Backup using rsync command === 
  
 == Backup Nginx configuration files ==  == Backup Nginx configuration files == 
Line 55: Line 75:
  
 ---- ----
 +=== Remote backup for webpages === 
 +Rsync with ''[TARGET]'' using rsync from ''[SOURCE]''  
 +<code bash> 
 +sudo -u www-data rsync -azP --exclude '.ssh' -e 'ssh -p [port_number]' --rsync-path="sudo rsync" /var/www/ [user]@[TARGET]:"/[TARGET PATH]../../"
 +</code> 
 +Put ''[SOURCE]'' public key in ''[TARGET]'' user's ''authorized_keys'' 
  
 +----
 ==== Configure log files ====  ==== Configure log files ==== 
  
Line 64: Line 91:
 </code>  </code> 
  
 +----
 ==== Purge log files ====  ==== Purge log files ==== 
  
Line 71: Line 99:
 </code>  </code> 
  
 +----
 +
 +==== Set hostnames ==== 
 +
 +<code bash> 
 +sudo hostname HOSTiD 
 +sudo hostnamectl HOSTiD 
 +</code> 
 +
 +Edit ''/etc/hostname'' with full domain name 
 +
 +<code bash> 
 +hostid.mydomain.com
 +</code> 
 +
 +----
 ==== Enable SSH ====  ==== Enable SSH ==== 
  
Line 116: Line 160:
 </code> </code>
    
 +=== Time stamp prompt === 
 +
 +Edit ''~/.bashrc'' and change ''PS1'' line 
 +
 +<code bash> 
 +if [ "$color_prompt" = yes ]; then
 +    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]: \[\033[01;33m\]\D{%T}\[\033[00m\] \[\033[01;37m\]\w\$\[\033[00m\] '
 +else
 +    PS1='${debian_chroot:+($debian_chroot)}\u@\h: \D{%T} \w\$ '
 +fi
 +</code> 
 +
 +Save and load ''.bashrc'' 
 +
 +<code bash> 
 +source ~/.bashrc 
 +</code> 
 +
  
 ---- ----
Line 458: Line 520:
 ---- ----
  
 +
 +
 +
 +===== Install Services ===== 
 +
 +==== Nextcloudโ„ข ====
 +
 +[[os_nextcloud|Nextcloud 101]] --- Nextcloud user's Guides
 +
 +----
  
 ===== Upgrade & Maintenance ===== ===== Upgrade & Maintenance =====
  • debian_common
  • Last modified: 2024/04/18 08:58
  • by Jรบne Park