Skip to content

Tinone 71

Stralci dal web

  • HOME
  • About me..
  • News
  • CIAO MAX
  • GALLERIE
    • Comics 2022
    • Fuochi Sant’ Eusebio 2022
    • Fulmini luglio 2021
    • Lago Antrona
    • Ferrara
    • Saline di Comacchio
    • Lido di Pomposa
    • Foto Varie
    • Pietra Ligure 2019
    • Schiranna 2019
    • Laveno Dicembre 2019
    • Incendio Ghirla
    • Forte di Bard Aosta
    • Costa Fascinosa 2023
  • MOTO
    • YAMAHA R1 1999
    • HONDA VTR 1000
    • CBR 600F
    • MUGELLO 2008
  • Privacy Policy
  • Assistenza Remota HopTodesk
  • Home
  • Script per backup automatico crontab
  • Linux

Script per backup automatico crontab

Admin 31 Gennaio 2011 1 min read

Piccolo script utile per lanciare copie automatiche da crontab o comprimere la cartella in un altra unita’ per il backup

si ringrazia Davide per lo script.

#!/bin/bash
logfile=”path della dir dove metto il log”

orig1=”path della cartella da fare copia/bk”
dest1=”path della destinazione”

echo -e “— Inizio Backup – “`date`” —” >> $logfile

# Esegue il backup con cp
echo -e ”   — Esecuzione CP —” >> $logfile
cp -rv $orig1 $dest1 >> $logfile 2>&1
echo -e ”   — Fine CP —” >> $logfile

orig2=”path della cartella da comprimere”
dest2=”path della destinazione”`date +%A`”.tgz”      la parte finale dal il nome della data al file

# Esegue il backup con tar
echo -e ”   — Esecuzione TAR —” >> $logfile
tar -czvf $dest2 $orig2 >> $logfile 2>&1
echo -e ”   — Fine TAR —” >> $logfile

echo -e “— Fine Backup – “`date`” —” >> $logfile   scrive il file log

Continue Reading

Previous: Blocco scheda di rete linux ubuntu
Next: Come montare unità NAS in linux

Related Stories

Vim Cheat Sheet
3 min read
  • Informatica
  • Linux

Vim Cheat Sheet

11 Dicembre 2020
Generate SSL Certificates With LetsEncrypt on Debian Linux
2 min read
  • Informatica
  • Linux

Generate SSL Certificates With LetsEncrypt on Debian Linux

3 Febbraio 2019
Activate LDAP user and group backend for Nextcloud
2 min read
  • Documenti
  • Informatica
  • Linux

Activate LDAP user and group backend for Nextcloud

28 Dicembre 2018
Copyright © All rights reserved. | DarkNews by AF themes.
Cookies
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Sempre abilitato
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
ACCETTA E SALVA