Automatic backup of folder
I have one particular folder on my linux box that I would like to have fully backed up and be able to "go back in time" on a file and see all previous revisions.
To add complications, this folder is shared (with the inbuilt sharing tools) and is accessed and written to by a Windows machine. For this reason, I'd like the backup to be written to a place where the windows machine does not have access.
How can I set this up?
backup
add a comment |
I have one particular folder on my linux box that I would like to have fully backed up and be able to "go back in time" on a file and see all previous revisions.
To add complications, this folder is shared (with the inbuilt sharing tools) and is accessed and written to by a Windows machine. For this reason, I'd like the backup to be written to a place where the windows machine does not have access.
How can I set this up?
backup
add a comment |
I have one particular folder on my linux box that I would like to have fully backed up and be able to "go back in time" on a file and see all previous revisions.
To add complications, this folder is shared (with the inbuilt sharing tools) and is accessed and written to by a Windows machine. For this reason, I'd like the backup to be written to a place where the windows machine does not have access.
How can I set this up?
backup
I have one particular folder on my linux box that I would like to have fully backed up and be able to "go back in time" on a file and see all previous revisions.
To add complications, this folder is shared (with the inbuilt sharing tools) and is accessed and written to by a Windows machine. For this reason, I'd like the backup to be written to a place where the windows machine does not have access.
How can I set this up?
backup
backup
asked Jul 28 '14 at 12:19
CheetahCheetah
197127
197127
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
Well I use the following script for my backup:
#! /bin/bash
# Gets date of most recent backup.
newestfile=$(cd /home/<USERNAME>/.Backups && find . -type f -printf '%T@ %pn' | sort -n | tail -1 | cut -f2- -d" ")
budate=`echo $newestfile| cut -c10-19`
# Gets current date
cdate=$(date --iso)
# If the cureent date is the same as the date of the most recent backup, don't run the backup, just give a notification that says it has already been done today.
if [ $cdate = $budate ]; then
echo "Backup Complete"
notify-send -i /home/<USERNAME>/Pictures/Logos/safe.png "Backup Status" "Already started/finished backup for today."
# If the dates are different, start the backup.
else
echo "Starting backup"
notify-send -i /home/<USERNAME>/Pictures/Logos/safe.png "Backup Status" "Starting backup for today."
# Compresses the files into .tar.gz format
tar -cvpzf /home/<USERNAME>/.Backups/backup-$(date +%Y-%m-%d-%H:%M).tar.gz "/home/<USERNAME>/folder/to/back/up" --exclude=.Backups && notify-send --expire-time=60000 -i /home/tim/Pictures/Home/Logos/safe.png 'Backup Status' 'Finished backup for today.'
fi
This will save a backup file that looks like this:
backup-2014-07-26-13:13.tar.gz
In the hidden folder /home/<USERNAME>/.Backups
The safe.png file that it used for the notifications can be downloaded from here.
Save the script in
/home/<USERNAME>/Scripts
asbackup.sh
Run the following commands:
chmod +x Scripts/backup.sh
mkdir .Backups
touch .Backups/backup-2000-01-01-00:00.tar.gz
Then add the command
Scripts/./backup.sh
to the start at login applications. Even if you login more than one time in a day, you only get 1 backup.
OR
You could also use cron to run the script regularly. Edit it using
crontab -e
and add this line to the end:
0 15 * * * bash /path/to/script/backup.sh
1
You could also use cron to execute it hourly, daily or weekly, depending on your needs. In this example, the script is executed daily at 3pm: Launch crontab viacrontab -e
and add the following line to the end0 15 * * * bash /path/to/script/backup.sh
– jnuk
Jul 28 '14 at 12:44
@jnuk Thank's, I never have understood cron enough to use it in an answer.
– Tim
Jul 28 '14 at 12:45
It's actually pretty simple. There are even generators for it.
– jnuk
Jul 28 '14 at 12:57
@jnuk Cool! That makes it easier!
– Tim
Jul 28 '14 at 13:00
add a comment |
The solution I chose in the end was something called "Back In Time". I set the backup interval to 5 minutes and it backs up my specific folders to another location and allows me to go back through the snapshots it takes.
http://backintime.le-web.org/
add a comment |
I did a little research and looked for GUI backup utilities that support at least Linux (they tended to be cross-platform). I also wanted good automation/interval capabilities. These are my 3 top picks, from what I read of reviews and can tell from intuition, all untested:
Back In Time (See documentation for screenshots)- fwbackups
grsync (GUI for rsync)
Hopefully that helps save others some time. There are a lot of backup utilities out there, but few with solid-looking GUI's for Linux that seemed to be modern.
Honorable mention: Duplicati, though I've used it before on Windows and I wasn't very fond of its instability. My backups were getting corrupted or glitchy. Maybe in the long run they will fix these issues.
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f503677%2fautomatic-backup-of-folder%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Well I use the following script for my backup:
#! /bin/bash
# Gets date of most recent backup.
newestfile=$(cd /home/<USERNAME>/.Backups && find . -type f -printf '%T@ %pn' | sort -n | tail -1 | cut -f2- -d" ")
budate=`echo $newestfile| cut -c10-19`
# Gets current date
cdate=$(date --iso)
# If the cureent date is the same as the date of the most recent backup, don't run the backup, just give a notification that says it has already been done today.
if [ $cdate = $budate ]; then
echo "Backup Complete"
notify-send -i /home/<USERNAME>/Pictures/Logos/safe.png "Backup Status" "Already started/finished backup for today."
# If the dates are different, start the backup.
else
echo "Starting backup"
notify-send -i /home/<USERNAME>/Pictures/Logos/safe.png "Backup Status" "Starting backup for today."
# Compresses the files into .tar.gz format
tar -cvpzf /home/<USERNAME>/.Backups/backup-$(date +%Y-%m-%d-%H:%M).tar.gz "/home/<USERNAME>/folder/to/back/up" --exclude=.Backups && notify-send --expire-time=60000 -i /home/tim/Pictures/Home/Logos/safe.png 'Backup Status' 'Finished backup for today.'
fi
This will save a backup file that looks like this:
backup-2014-07-26-13:13.tar.gz
In the hidden folder /home/<USERNAME>/.Backups
The safe.png file that it used for the notifications can be downloaded from here.
Save the script in
/home/<USERNAME>/Scripts
asbackup.sh
Run the following commands:
chmod +x Scripts/backup.sh
mkdir .Backups
touch .Backups/backup-2000-01-01-00:00.tar.gz
Then add the command
Scripts/./backup.sh
to the start at login applications. Even if you login more than one time in a day, you only get 1 backup.
OR
You could also use cron to run the script regularly. Edit it using
crontab -e
and add this line to the end:
0 15 * * * bash /path/to/script/backup.sh
1
You could also use cron to execute it hourly, daily or weekly, depending on your needs. In this example, the script is executed daily at 3pm: Launch crontab viacrontab -e
and add the following line to the end0 15 * * * bash /path/to/script/backup.sh
– jnuk
Jul 28 '14 at 12:44
@jnuk Thank's, I never have understood cron enough to use it in an answer.
– Tim
Jul 28 '14 at 12:45
It's actually pretty simple. There are even generators for it.
– jnuk
Jul 28 '14 at 12:57
@jnuk Cool! That makes it easier!
– Tim
Jul 28 '14 at 13:00
add a comment |
Well I use the following script for my backup:
#! /bin/bash
# Gets date of most recent backup.
newestfile=$(cd /home/<USERNAME>/.Backups && find . -type f -printf '%T@ %pn' | sort -n | tail -1 | cut -f2- -d" ")
budate=`echo $newestfile| cut -c10-19`
# Gets current date
cdate=$(date --iso)
# If the cureent date is the same as the date of the most recent backup, don't run the backup, just give a notification that says it has already been done today.
if [ $cdate = $budate ]; then
echo "Backup Complete"
notify-send -i /home/<USERNAME>/Pictures/Logos/safe.png "Backup Status" "Already started/finished backup for today."
# If the dates are different, start the backup.
else
echo "Starting backup"
notify-send -i /home/<USERNAME>/Pictures/Logos/safe.png "Backup Status" "Starting backup for today."
# Compresses the files into .tar.gz format
tar -cvpzf /home/<USERNAME>/.Backups/backup-$(date +%Y-%m-%d-%H:%M).tar.gz "/home/<USERNAME>/folder/to/back/up" --exclude=.Backups && notify-send --expire-time=60000 -i /home/tim/Pictures/Home/Logos/safe.png 'Backup Status' 'Finished backup for today.'
fi
This will save a backup file that looks like this:
backup-2014-07-26-13:13.tar.gz
In the hidden folder /home/<USERNAME>/.Backups
The safe.png file that it used for the notifications can be downloaded from here.
Save the script in
/home/<USERNAME>/Scripts
asbackup.sh
Run the following commands:
chmod +x Scripts/backup.sh
mkdir .Backups
touch .Backups/backup-2000-01-01-00:00.tar.gz
Then add the command
Scripts/./backup.sh
to the start at login applications. Even if you login more than one time in a day, you only get 1 backup.
OR
You could also use cron to run the script regularly. Edit it using
crontab -e
and add this line to the end:
0 15 * * * bash /path/to/script/backup.sh
1
You could also use cron to execute it hourly, daily or weekly, depending on your needs. In this example, the script is executed daily at 3pm: Launch crontab viacrontab -e
and add the following line to the end0 15 * * * bash /path/to/script/backup.sh
– jnuk
Jul 28 '14 at 12:44
@jnuk Thank's, I never have understood cron enough to use it in an answer.
– Tim
Jul 28 '14 at 12:45
It's actually pretty simple. There are even generators for it.
– jnuk
Jul 28 '14 at 12:57
@jnuk Cool! That makes it easier!
– Tim
Jul 28 '14 at 13:00
add a comment |
Well I use the following script for my backup:
#! /bin/bash
# Gets date of most recent backup.
newestfile=$(cd /home/<USERNAME>/.Backups && find . -type f -printf '%T@ %pn' | sort -n | tail -1 | cut -f2- -d" ")
budate=`echo $newestfile| cut -c10-19`
# Gets current date
cdate=$(date --iso)
# If the cureent date is the same as the date of the most recent backup, don't run the backup, just give a notification that says it has already been done today.
if [ $cdate = $budate ]; then
echo "Backup Complete"
notify-send -i /home/<USERNAME>/Pictures/Logos/safe.png "Backup Status" "Already started/finished backup for today."
# If the dates are different, start the backup.
else
echo "Starting backup"
notify-send -i /home/<USERNAME>/Pictures/Logos/safe.png "Backup Status" "Starting backup for today."
# Compresses the files into .tar.gz format
tar -cvpzf /home/<USERNAME>/.Backups/backup-$(date +%Y-%m-%d-%H:%M).tar.gz "/home/<USERNAME>/folder/to/back/up" --exclude=.Backups && notify-send --expire-time=60000 -i /home/tim/Pictures/Home/Logos/safe.png 'Backup Status' 'Finished backup for today.'
fi
This will save a backup file that looks like this:
backup-2014-07-26-13:13.tar.gz
In the hidden folder /home/<USERNAME>/.Backups
The safe.png file that it used for the notifications can be downloaded from here.
Save the script in
/home/<USERNAME>/Scripts
asbackup.sh
Run the following commands:
chmod +x Scripts/backup.sh
mkdir .Backups
touch .Backups/backup-2000-01-01-00:00.tar.gz
Then add the command
Scripts/./backup.sh
to the start at login applications. Even if you login more than one time in a day, you only get 1 backup.
OR
You could also use cron to run the script regularly. Edit it using
crontab -e
and add this line to the end:
0 15 * * * bash /path/to/script/backup.sh
Well I use the following script for my backup:
#! /bin/bash
# Gets date of most recent backup.
newestfile=$(cd /home/<USERNAME>/.Backups && find . -type f -printf '%T@ %pn' | sort -n | tail -1 | cut -f2- -d" ")
budate=`echo $newestfile| cut -c10-19`
# Gets current date
cdate=$(date --iso)
# If the cureent date is the same as the date of the most recent backup, don't run the backup, just give a notification that says it has already been done today.
if [ $cdate = $budate ]; then
echo "Backup Complete"
notify-send -i /home/<USERNAME>/Pictures/Logos/safe.png "Backup Status" "Already started/finished backup for today."
# If the dates are different, start the backup.
else
echo "Starting backup"
notify-send -i /home/<USERNAME>/Pictures/Logos/safe.png "Backup Status" "Starting backup for today."
# Compresses the files into .tar.gz format
tar -cvpzf /home/<USERNAME>/.Backups/backup-$(date +%Y-%m-%d-%H:%M).tar.gz "/home/<USERNAME>/folder/to/back/up" --exclude=.Backups && notify-send --expire-time=60000 -i /home/tim/Pictures/Home/Logos/safe.png 'Backup Status' 'Finished backup for today.'
fi
This will save a backup file that looks like this:
backup-2014-07-26-13:13.tar.gz
In the hidden folder /home/<USERNAME>/.Backups
The safe.png file that it used for the notifications can be downloaded from here.
Save the script in
/home/<USERNAME>/Scripts
asbackup.sh
Run the following commands:
chmod +x Scripts/backup.sh
mkdir .Backups
touch .Backups/backup-2000-01-01-00:00.tar.gz
Then add the command
Scripts/./backup.sh
to the start at login applications. Even if you login more than one time in a day, you only get 1 backup.
OR
You could also use cron to run the script regularly. Edit it using
crontab -e
and add this line to the end:
0 15 * * * bash /path/to/script/backup.sh
edited Jul 28 '14 at 12:58
Alaa Ali
22.5k96994
22.5k96994
answered Jul 28 '14 at 12:34
TimTim
20k1586141
20k1586141
1
You could also use cron to execute it hourly, daily or weekly, depending on your needs. In this example, the script is executed daily at 3pm: Launch crontab viacrontab -e
and add the following line to the end0 15 * * * bash /path/to/script/backup.sh
– jnuk
Jul 28 '14 at 12:44
@jnuk Thank's, I never have understood cron enough to use it in an answer.
– Tim
Jul 28 '14 at 12:45
It's actually pretty simple. There are even generators for it.
– jnuk
Jul 28 '14 at 12:57
@jnuk Cool! That makes it easier!
– Tim
Jul 28 '14 at 13:00
add a comment |
1
You could also use cron to execute it hourly, daily or weekly, depending on your needs. In this example, the script is executed daily at 3pm: Launch crontab viacrontab -e
and add the following line to the end0 15 * * * bash /path/to/script/backup.sh
– jnuk
Jul 28 '14 at 12:44
@jnuk Thank's, I never have understood cron enough to use it in an answer.
– Tim
Jul 28 '14 at 12:45
It's actually pretty simple. There are even generators for it.
– jnuk
Jul 28 '14 at 12:57
@jnuk Cool! That makes it easier!
– Tim
Jul 28 '14 at 13:00
1
1
You could also use cron to execute it hourly, daily or weekly, depending on your needs. In this example, the script is executed daily at 3pm: Launch crontab via
crontab -e
and add the following line to the end 0 15 * * * bash /path/to/script/backup.sh
– jnuk
Jul 28 '14 at 12:44
You could also use cron to execute it hourly, daily or weekly, depending on your needs. In this example, the script is executed daily at 3pm: Launch crontab via
crontab -e
and add the following line to the end 0 15 * * * bash /path/to/script/backup.sh
– jnuk
Jul 28 '14 at 12:44
@jnuk Thank's, I never have understood cron enough to use it in an answer.
– Tim
Jul 28 '14 at 12:45
@jnuk Thank's, I never have understood cron enough to use it in an answer.
– Tim
Jul 28 '14 at 12:45
It's actually pretty simple. There are even generators for it.
– jnuk
Jul 28 '14 at 12:57
It's actually pretty simple. There are even generators for it.
– jnuk
Jul 28 '14 at 12:57
@jnuk Cool! That makes it easier!
– Tim
Jul 28 '14 at 13:00
@jnuk Cool! That makes it easier!
– Tim
Jul 28 '14 at 13:00
add a comment |
The solution I chose in the end was something called "Back In Time". I set the backup interval to 5 minutes and it backs up my specific folders to another location and allows me to go back through the snapshots it takes.
http://backintime.le-web.org/
add a comment |
The solution I chose in the end was something called "Back In Time". I set the backup interval to 5 minutes and it backs up my specific folders to another location and allows me to go back through the snapshots it takes.
http://backintime.le-web.org/
add a comment |
The solution I chose in the end was something called "Back In Time". I set the backup interval to 5 minutes and it backs up my specific folders to another location and allows me to go back through the snapshots it takes.
http://backintime.le-web.org/
The solution I chose in the end was something called "Back In Time". I set the backup interval to 5 minutes and it backs up my specific folders to another location and allows me to go back through the snapshots it takes.
http://backintime.le-web.org/
answered Jul 31 '14 at 8:48
CheetahCheetah
197127
197127
add a comment |
add a comment |
I did a little research and looked for GUI backup utilities that support at least Linux (they tended to be cross-platform). I also wanted good automation/interval capabilities. These are my 3 top picks, from what I read of reviews and can tell from intuition, all untested:
Back In Time (See documentation for screenshots)- fwbackups
grsync (GUI for rsync)
Hopefully that helps save others some time. There are a lot of backup utilities out there, but few with solid-looking GUI's for Linux that seemed to be modern.
Honorable mention: Duplicati, though I've used it before on Windows and I wasn't very fond of its instability. My backups were getting corrupted or glitchy. Maybe in the long run they will fix these issues.
New contributor
add a comment |
I did a little research and looked for GUI backup utilities that support at least Linux (they tended to be cross-platform). I also wanted good automation/interval capabilities. These are my 3 top picks, from what I read of reviews and can tell from intuition, all untested:
Back In Time (See documentation for screenshots)- fwbackups
grsync (GUI for rsync)
Hopefully that helps save others some time. There are a lot of backup utilities out there, but few with solid-looking GUI's for Linux that seemed to be modern.
Honorable mention: Duplicati, though I've used it before on Windows and I wasn't very fond of its instability. My backups were getting corrupted or glitchy. Maybe in the long run they will fix these issues.
New contributor
add a comment |
I did a little research and looked for GUI backup utilities that support at least Linux (they tended to be cross-platform). I also wanted good automation/interval capabilities. These are my 3 top picks, from what I read of reviews and can tell from intuition, all untested:
Back In Time (See documentation for screenshots)- fwbackups
grsync (GUI for rsync)
Hopefully that helps save others some time. There are a lot of backup utilities out there, but few with solid-looking GUI's for Linux that seemed to be modern.
Honorable mention: Duplicati, though I've used it before on Windows and I wasn't very fond of its instability. My backups were getting corrupted or glitchy. Maybe in the long run they will fix these issues.
New contributor
I did a little research and looked for GUI backup utilities that support at least Linux (they tended to be cross-platform). I also wanted good automation/interval capabilities. These are my 3 top picks, from what I read of reviews and can tell from intuition, all untested:
Back In Time (See documentation for screenshots)- fwbackups
grsync (GUI for rsync)
Hopefully that helps save others some time. There are a lot of backup utilities out there, but few with solid-looking GUI's for Linux that seemed to be modern.
Honorable mention: Duplicati, though I've used it before on Windows and I wasn't very fond of its instability. My backups were getting corrupted or glitchy. Maybe in the long run they will fix these issues.
New contributor
New contributor
answered 13 mins ago
AndrewAndrew
1012
1012
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f503677%2fautomatic-backup-of-folder%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown