2

I can make a simple script that performs most of what I require, but I'd like to see if there is a solution already created out to accomplish what I desire.

Essentially, at present, there is a locally attached storage device on my PC, that I would like to soon create a share direct from my home modem. From this applet, I want to be able to create backups (compressed at the same time), save them to a network location (which will be the share), create a log of successful completion, and also move old backups to another directory (perhaps also delete X days old).

Whilst also local, it'd be good if I could encrypt the files for data integrity and perhaps also edit the permissions to the directory. For the files on the directory, I'd like to restrict users being able to access it based on user accounts - I am hoping I can edit the permissions based upon the UI (with a username and password) as I am not running a domain or home-group and cannot use NT/Share permissions (that I am aware of).

Currently I was thinking of:

  • Using Robocopy for the transfer and output of data
  • Using 7Zipfm.exe for the compression and also the password protection
  • Using icalcsto manage the permissions on the file

Then simply using the net use command to map the UNC path to PC's, distribute the script and then have a backup process in place.

In the hopes of improving this process, I would like to:

  • Be able to manage versions, remove X old days (I know I can use some method of last modified to do this with Robocopy)
  • Be able to schedule this to run at X time, or if missed (I can do this through Task Scheduler I know)

For other reasons, I do not want to have a GUI to this tool (or at least, one existing out of a terminal). So tools like Cobian Backup are not a valid option.

Lastly some advanced features I'd love to incorporate would be:

  • Naming the backup based on the date
  • Having a different share for a user, and having the script/applet auto-determine this based on the user logged in (some PC's have multiple accounts)
  • Perhaps checking to ensure the destination is reachable, or if another is online (I will hot-swap devices occasionally)

If anyone has scripts/programs that match this please let me know, else I will just forge on with making a script.

TL;DR - In depth CLI backup option that has similar functions to Cobian Backup.

2
  • I think that rsnapshot would do the job. I installed it on my OpenWRT router and make all backups on disk drive plugged into the router. It uses rsync under the hood and is very *Unixy* in nature. I first learned about it after reading this review by Eric Raymond titled rsnapshot: you’re doing it right!: esr.ibiblio.org/?p=3124http://esr.ibiblio.org/?p=3124 Oct 1, 2016 at 10:25
  • @ArkadiuszDrabczyk Thanks for the suggestion. Unfortunately, OpenWRT does not support my device (using stock ISP provided modem/router as they do not supposedly support other devices). I have no qualm in purchasing and configuring a device, but would like that as the last option. But please feel free to make that an answer, it deserves a markup and would also benefit others trying to succeed with this.
    – DankyNanky
    Oct 1, 2016 at 11:00

1 Answer 1

1

You seem to use Windows and look for Windows-based solution so this answer may not apply to you at all.

I think that rsnapshot would do the job. I installed it on my OpenWRT router and make all backups on disk drive plugged into the router. It uses rsync under the hood and is very Unixy in nature. I first learned about it after reading this review by Eric Raymond titled rsnapshot: you’re doing it right!. It can create a tree of snapshots like this:

/mnt/disk/snapshots $ ll
drwxr-xr-x    3 root     root        4.0K Jun 24 00:07 monthly.2
drwxr-xr-x    3 root     root        4.0K Jul 25 00:07 monthly.1
drwxr-xr-x    3 root     root        4.0K Aug 25 00:06 monthly.0
drwxr-xr-x    3 root     root        4.0K Sep 24 00:06 daily.6
drwxr-xr-x    3 root     root        4.0K Sep 25 00:06 daily.5
drwxr-xr-x    3 root     root        4.0K Sep 26 00:06 daily.4
drwxr-xr-x    3 root     root        4.0K Sep 27 00:06 daily.3
drwxr-xr-x    3 root     root        4.0K Sep 28 00:07 daily.2
drwxr-xr-x    3 root     root        4.0K Sep 29 00:07 daily.1
drwxr-xr-x    3 root     root        4.0K Sep 30 00:06 daily.0
drwxr-xr-x    3 root     root        4.0K Sep 30 12:12 hourly.5
drwxr-xr-x    3 root     root        4.0K Sep 30 16:12 hourly.4
drwxr-xr-x    3 root     root        4.0K Sep 30 20:13 hourly.3
drwxr-xr-x    3 root     root        4.0K Oct  1 00:05 hourly.2
drwxr-xr-x    3 root     root        4.0K Oct  1 04:12 hourly.1
drwxr-xr-x    3 root     root        4.0K Oct  1 08:12 hourly.0

It can be invoked from cron:

$ crontab -e
0 */4 * * *       /usr/bin/rsnapshot hourly
30 23 * * *       /usr/bin/rsnapshot daily
15 22 1 * *       /usr/bin/rsnapshot monthly

However, to meet your requirement Be able to schedule this to run at X time, or if missed (I can do this through Task Scheduler I know) you should go with anacron or something similar that can postpone task execution until server is up again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.