spirit posteets tagged ssh  [ Profile ]

Sort by: Date / Title /

  1. 6 years ago
    1. ssh root@remote.host "rpm -qa" | xargs yum -y install
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2170"></script>
  2. 6 years ago and saved by 1 other
    1. dateset="$(sshuser@server date)"
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2169"></script>
  3. 6 years ago
    1. mysqldump –add-drop-table –extended-insert –force –log-error=error.log -uUSER -pPASS OLD_DB_NAME | ssh -C user@newhost "mysql -uUSER -pPASS NEW_DB_NAME"
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/2167"></script>
  4. sponsorised links
  5. 11 years ago and saved by 1 other
    1. Par exemple, pour connaitre la place utilisee en memoire par le processus apache2 :
    2. ps -ely | grep '\<apache2\>' | awk '{SUM += $8} END {print SUM}'
    3.  
    4. ou pour connaitre la place en Ko prise par tous les fichiers PNG du repertoire :
    5. ls -l *.png | awk '{SUM += $5} END {print SUM/1024}'
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/422"></script>
  6. 11 years ago and saved by 2 others
    1. #!/bin/bash
    2.  
    3. TAR_COMPRESS="tar cjvf" # Commande de compression
    4. BACKUP_EXTENSION="tar.bz2" # Extension des fichiers compressés
    5. DATE=`date '+%d-%m-%Y'`
    6. BACKUP_ADDRESS="sav@server.org"
    7. BACKUP_DIR="/directory"
    8.  
    9.  
    10.  
    11. echo "Sauvegarde des fichiers"
    12.  
    13. echo "On sauvegarde et on envoie le home"
    14. cd /home
    15. for i in `ls`
    16. do
    17.                 $TAR_COMPRESS $i-$DATE.$BACKUP_EXTENSION /home/$i/*
    18.                 echo "`date` debut scp $i" >> /var/log/backup.log
    19.                 scp $i-$DATE.$BACKUP_EXTENSION $BACKUP_ADDRESS:$BACKUP_DIR
    20.                 echo "`date` fin scp $i" >> /var/log/backup.log
    21.                 rm -f $i-$DATE.$BACKUP_EXTENSION
    22. done
    23.  
    24. echo "On sauvegarde et on envoie le home du root "
    25. $TAR_COMPRESS root-$DATE.$BACKUP_EXTENSION /root/
    26. echo "`date` debut scp /root" >> /var/log/backup.log
    27. scp root-$DATE.$BACKUP_EXTENSION $BACKUP_ADDRESS:$BACKUP_DIR
    28. echo "`date` fin scp /root" >> /var/log/backup.log
    29. rm -f root-$DATE.$BACKUP_EXTENSION
    30. echo "On sauvegarde et on envoie le etc"
    31. $TAR_COMPRESS etc-$DATE.$BACKUP_EXTENSION /etc/
    32. echo "`date` debut scp /etc" >> /var/log/backup.log
    33. scp etc-$DATE.$BACKUP_EXTENSION $BACKUP_ADDRESS:$BACKUP_DIR
    34. echo "`date` fin scp /etc" >> /var/log/backup.log
    35. rm -f etc-$DATE.$BACKUP_EXTENSION
    36.  
    37. echo "On passe au dump MySQL"
    38. MYSQL_USER="root" # User mySQL à utiliser pour faire le dump
    39. MYSQL_PASSWORD="pass" # Mot de passe root de la base mySQL
    40. MYSQL_HOST="localhost" # Host de la base mySQL
    41. SQL_LIST_DB="SHOW DATABASES;" # Requete SQL listant toutes les bases
    42.  
    43. cd /home/backup/dumpsql
    44. echo "Dump de toutes les bases MySQL"
    45. mysqldump -p"$MYSQL_PASSWORD" --all-databases > all-databases.$DATE.sql
    46.  
    47. echo "Compression et envoie du dump"
    48. $TAR_COMPRESS  all-databases-$DATE.sql.$BACKUP_EXTENSION all-databases.$DATE.sql
    49. echo "`date` debut scp all databases" >> /var/log/backup.log
    50. scp all-databases-$DATE.sql.$BACKUP_EXTENSION $BACKUP_ADDRESS:$BACKUP_DIR
    51. echo "`date` fin scp all databases" >> /var/log/backup.log
    52. rm -f all-databases.$DATE.sql
    53. rm -f all-databases-$DATE.sql.$BACKUP_EXTENSION
    54.  
    55. echo "Dump base par base"
    56. for database in `echo $SQL_LIST_DB | mysql -u $MYSQL_USER -p"$MYSQL_PASSWORD" -h $MYSQL_HOST | sed 1d`
    57. do
    58.  
    59.         mysqldump -p"$MYSQL_PASSWORD" --databases $database > $database-$DATE.sql
    60.  
    61.         $TAR_COMPRESS $database-$DATE.sql.$BACKUP_EXTENSION $database-$DATE.sql
    62.         rm -f $database-$DATE.sql
    63. done
    64.  
    65. echo "On sauvegarde le dump des bases et on l'envoie"
    66. $TAR_COMPRESS dump-$DATE.$BACKUP_EXTENSION *.*.sql.$BACKUP_EXTENSION
    67. echo "`date` debut scp base par base" >> /var/log/backup.log
    68. scp dump-$DATE.$BACKUP_EXTENSION $BACKUP_ADDRESS:$BACKUP_DIR
    69. echo "`date` fin scp base par base" >> /var/log/backup.log
    70. rm -f dump-$DATE.$BACKUP_EXTENSION
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/353"></script>
  7. 11 years ago
    1. vim /etc/ssh/sshd_config
    2. # PermitRootLogin yes
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/61"></script>
  8. 11 years ago
    1. # Permet de se connecter en SSH sans mot de passe de SOURCE vers DESTINATION
    2. # SOURCE
    3. # Création de la clé publique id_dsa.pub (souvent dans ~/.ssh). Il faut ensuite la transférer sur DESTINATION
    4. ssh-keygen -t dsa
    5.  
    6. # DESTINATION
    7. # Copier la clé publique de SOURCE dans le fichier .ssh/authorized_keys de la DESTINATION
    8. cat id_dsa.pub >> ~/.ssh/authorized_keys
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/47"></script>

First / Previous / Next / Last / Page 1 of 1 (7 posteets)