On 12/14/2017 04:45 PM, Tiago Baptista wrote: > No, I'm sorry. > > What I tried to know, is if is there is a way to get only the lastest file > from a folder in a FileSet. > > I want to make a backup from just one file in the folder, the lastest file > that was created.
Hi Tiago, you responded to me directly, so I am bringing this back to the mailing list so the thread is complete. :) Well, there are a couple ways to look at this: Option 1: By default, if you set a job to have a Level = Incremental then, only files that have changed or that were created new since the last backup will be backed up If, however, you have something special going on in this directory, and you do not care about any files except this one file with the newest timestamp, and all other files should be ignored, there is a way to do this, but it is just a little bit more complicated.... So, on to Option 2... Option 2: Bacula has the ability to back up files based on dynamically created file lists which can be created on-the-fly at the time the job starts. To get you started, take a look at the "The FileSet Resource" chapter in the main manual, then see below: In the Include{} section of a FileSet, you can specify files or directories to backup using the normal syntax: File = /home # A directory and all subdirs File = /boot # A directory and all subdirs File = /etc/hosts # A specific file This is clearly not what you want. :) BUT... there are several ways to create a dynamic list of files to back up. What I think you are looking for is this syntax: File ="\\|/etc/bacula/scripts/oneSpecialFile.sh" This syntax tells Bacula to run the script called "oneSpecialFile.sh" which lives in the /etc/bacula/scripts directory on the *client* machine. Then, this script has to be written so that it only returns the full path to this one file you are interested in backing up. For example: Contents of /etc/bacula/scripts/oneSpecialFile.sh: ----8<---- #!/bin/sh # # Print the name of the newest file in some special directory dir="/path/to/special/directory" # List only files in this directory, reverse sort by ctime, # print one line, and finally just print the filename file=$(ls -cltr ${dir} | grep "^-" | tail -n1 | awk '{ print $9 }') echo "${dir}/${file}" exit 0 ----8<---- Does this help get you going in the right direction? Best regards, Bill -- Bill Arlofski http://www.revpol.com/bacula -- Not responsible for anything below this line -- ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users