• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. Bristow 0
    3. Best
    B
    • Profile
    • Following 0
    • Followers 0
    • Topics 15
    • Posts 59
    • Best 7
    • Controversial 0
    • Groups 0

    Best posts made by Bristow 0

    • RE: Script for a backup ?

      Thanks a lot @rodluz !

      I took your script and adapted it. I use it directly on my FOG server, which simplifies things a bit. I also changed the mail to a notification sent to my smartphone with ntfy, which I find easy to use.

      I also mounted my NAS share in NFS directly on /mnt/FOGBackups.

      Here’s my script:

      #!/bin/bash
      
      fogServerAddress="172.X.Y.Z"  # Change to actual FOG server address
      
      backupDate=$(date +"%Y%m%d")
      
      backupDir="/mnt/FOGBackups/$backupDate"
      backupDirImages="/mnt/FOGBackups/images"
      
      snapinLocation="/opt/fog/snapins"
      reportLocation="/var/www/fog/lib/reports"
      imageLocation="/images"
      
      failedBackupDB=0
      failedBackupSnapins=0
      failedBackupReports=0
      failedBackupImages=0
      
      [[ ! -d $backupDir ]] && mkdir -p $backupDir/{mysql,snapins,reports,logs} >/dev/null 2>&1
      [[ ! -d $backupDir/mysql || $backupDir/snapins || $backupDir/reports || $backupDir/logs ]] && mkdir -p $backupDir/{mysql,snapins,reports,logs} >/dev/null 2>&1
      
      backupDB() {
          wget --no-check-certificate --post-data="nojson=1" -O $backupDir/mysql/fog.sql "http://$fogServerAddress/fog/management/export.php?type=sql" 2>>$backupDir/logs/error.log 1>>$backupDir/logs/progress.log 2>&1
          stat=$?
          if [[ ! $stat -eq 0 ]]; then
              echo "Failed to backup database!"
              failedBackupDB=1
          else
              echo "Database backed up."
          fi
      }
      
      backupSnapins() {
          cp -r $snapinLocation $backupDir/snapins/ 2>>$backupDir/logs/error.log 1>>$backupDir/logs/progress.log 2>&1
          stat=$?
          if [[ ! $stat -eq 0 ]]; then
              echo "Failed to backup snapins!"
              failedBackupSnapins=1
          else
              echo "Snapins backed up."
          fi
      }
      
      backupReports() {
          cp -r $reportLocation $backupDir/reports/ 2>>$backupDir/logs/error.log 1>>$backupDir/logs/progress.log 2>&1
          stat=$?
          if [[ ! $stat -eq 0 ]]; then
              echo "Failed to backup reports!"
              failedBackupReports=1
          else
              echo "Reports backed up."
          fi
      }
      
      backupImages() {
          rsync -auv $imageLocation $backupDirImages 2>>$backupDir/logs/error.log 1>>$backupDir/logs/progress.log 2>&1
          stat=$?
          if [[ ! $stat -eq 0 ]]; then
              echo "Failed to backup images!"
              failedBackupImages=1
          else
              echo "Images backed up."
          fi
      }
      
      checkForFailures() {
          echo "Running checkForFailures()"
          if [[ $failedBackupDB -eq 1 ]]; then
              message="$message \nFailed to backup database."
          fi
      
          if [[ $failedBackupSnapins -eq 1 ]]; then
              message="$message \nFailed to backup snapins."
          fi
      
          if [[ $failedBackupReports -eq 1 ]]; then
              message="$message \nFailed to backup reports."
          fi
          if [[ $failedBackupImages -eq 1 ]]; then
              message="$message \nFailed to backup images."
          fi
      }
      
      sendNotif() {
      	echo "Running sendNotif()"
          if [[ ! -z $message ]]; then
              {
                  curl -d "FOG Backup Failed\n $message" ntfy.sh/XYZATEHFJICH
      		}
      	else
      		curl -d "FOG Backup Successful!" ntfy.sh/XYZATEHFJICH
      	fi
      }
      
      backupDB
      backupSnapins
      backupReports
      backupImages
      
      checkForFailures
      sendNotif
      
      
      posted in General Problems
      B
      Bristow 0
    • Small errors in migration commands

      I have just migrated a Fog from one server to another and I noticed 2 small problems on this page: https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG#Arranging_Images

      The following command generates 2 messages :

      root@fogserver:~# mv /images/dev/* /images
      mv: Cannot move '/images/dev/dev' to '/images/dev': The folder is not empty.
      mv: Cannot move '/images/dev/postdownloadscripts' to '/images/postdownloadscripts': The folder is not empty.
      

      I don’t think it’s serious, is it?

      But this one is more annoying:

      root@fogserver:~# chown -R fog:root /images
      chown: incorrect user: " fog:root ".
      

      The fog user does not exist, it is fogproject. So I replaced by this command:

      chown -R fogproject:root /images
      

      Thanks for this amazing project !

      posted in General
      B
      Bristow 0
    • RE: [Solved] Grub rescue after deploy task

      @Sebastian-Roth you put me on the track!

      The bios was configured in legacy bios first, I switched to uefi first and it works!

      Thank you!

      posted in Linux Problems
      B
      Bristow 0
    • RE: Migrating FOG from a Optiplex 7010 to a dedicated server?

      @tesparza

      I made the same thing with this doc : https://wiki.fogproject.org/wiki/index.php?title=Migrate_FOG

      posted in General Problems
      B
      Bristow 0
    • RE: FOG Project call for engagement

      @lemeunier said in FOG Project call for engagement:

      PS: j’ai la flemme de traduire ça en anglais…

      Pourtant, cela prend 3 s avec https://www.deepl.com/translator

      Hello Sebastian, Hello Tom

      First of all, I would like to salute your work which is very helpful for us on a regional scale (Hauts-de-France, France).
      The development of FogProject systems is unquestionably irreproachable and indispensable for large structures such as ours.

      Have you thought about switching to a business model geared towards professionals, like WAPT?
      We would be delighted to collaborate with you in this context, and this would allow you to recruit developers in a paid way.

      Best regards.

      (Ne compliquons pas la vie des développeurs)

      posted in Announcements
      B
      Bristow 0
    • RE: Update french translation for Fog 1.5.9

      I have made good progress on the translation of FOG into French.

      There was a lot of work. Currently, I’m trying to translate directly in PoEdit but is there a solution to see my work in FOG, knowing that I installed FOG (dev-branch) on a VM…

      Thanks !

      PS : I should be able to push my file this week…

      posted in General
      B
      Bristow 0
    • RE: Translate the FOG project website

      @wayne-workman The Google translation of technical project is just awful. Deepl gives much better results.

      Besides, I hardly ever use Google and even less Google Chrome 😉

      I’m waiting for Tom’s answer 🙂

      posted in General
      B
      Bristow 0
    • 1 / 1